Skip to content

Commit

Permalink
better socket path error logging
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@14284 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Oct 26, 2016
1 parent 38a6b27 commit bd3de07
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/xpra/scripts/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,18 +578,28 @@ def setup_local_sockets(bind, socket_dir, socket_dirs, display_name, clobber, mm
if sockpath.startswith("/var/run/xpra"):
log.warn("Warning: cannot create socket '%s'", sockpath)
log.warn(" %s", e)
if not os.path.exists("/var/run/xpra"):
log.warn(" %s does not exist", "/var/run/xpra")
if os.name=="posix":
uid = getuid()
username = get_username_for_uid(uid)
groups = get_groups(username)
log.warn(" user '%s' is a member of groups: %s", username, csv(groups))
if "xpra" not in groups:
log.warn(" (missing 'xpra' group membership?)")
try:
import stat
log.warn(" permissions on %s: %s", "/var/run/xpra", oct(stat.S_IMODE(os.stat("/var/run/xpra").st_mode)))
except:
pass
continue
elif sockpath.startswith("/var/run/user") or sockpath.startswith("/run/user"):
log.warn("Warning: cannot create socket '%s':", sockpath)
log.warn(" %s", e)
log.warn(" ($XDG_RUNTIME_DIR has not been created?)")
if not os.path.exists("/var/run/user"):
log.warn(" %s does not exist", "/var/run/user")
else:
log.warn(" ($XDG_RUNTIME_DIR has not been created?)")
continue
else:
log.error("Error: failed to create socket '%s':", sockpath)
Expand Down

0 comments on commit bd3de07

Please sign in to comment.