Xpra: Ticket #1698: server fails when logging to ~/.xpra/

The parsing for option 'log-dir' does not seem to be expanding shell variables, such as ~, $HOME, or $USER, and causes the server to fail when the 'log-dir' option is set with those variables.

PART 1

When changing option log-dir in file /etc/xpra/60_server.conf from its default "auto" to "~/.xpra", the xpra server fails to launch. The alternative "~/.xpra" is provided for in the comments for the config file. The entire STDERR output is

Warning: cannot use the system proxy for 'start' subcommand,
 failed to connect to '/run/xpra/system':
 [Errno 111] Connection refused
InitException: cannot open log file '~/.xpra/S9585.log': [Errno 2] No such file or directory: '~/.xpra/S9585.log'
xpra initialization error:
 cannot open log file '~/.xpra/S9585.log': [Errno 2] No such file or directory: '~/.xpra/S9585.log'

However, the directory does exist, with adequate permissions, and xpra does create two files there (a commented-out 'xpra.conf', and a 'run-xpra' executable).

When reverting the log-dir option to its default, 'auto', the server does start, but the log file, at /run/user/$UID/xpra/:1.log includes:

failed to rename Xorg log file from '/run/user/1007/xpra/Xorg.S13030.log' to '/run/user/1007/xpra/Xorg.:1.log'
 [Errno 2] No such file or directory
-- END---------------

The log files that do exist are: :1.log and Xorg.S13030.log.old

PART 2

Experimenting with the option on both the command-line and in the config file showed that the server WOULD succeed when the explicit path to ~/.xpra was used, ie. /home/.../.xpra, and would fail with the same output as above for $HOME/.xpra and /home/$USER/.xpra



Fri, 24 Nov 2017 09:42:56 GMT - Antoine Martin: status, description changed

failed to rename Xorg...

This one is not a bug in xpra but a bug in the Xorg server: #1192. There is a patch, which is languishing upstream. I think they need a nudge.

As for the rest, I will take a look. Please always include full OS version, as this may be relevant when debugging.


Fri, 24 Nov 2017 15:05:01 GMT - Boruch:

Oops.

Version: Xpra gtk2 client version 2.1.3-r17247 64-bit Platform: Debian Stretch / Devuan Ascii Kernel: Linux 4.9.0-3-amd64 [Debian version: 4.9.30-2+deb9u5 (2017-09-19)]


Sat, 25 Nov 2017 14:46:11 GMT - Antoine Martin: status changed; resolution set

Fixed in r17502. (I will have to come up with a more concise fix for older branches)


Sat, 23 Jan 2021 05:31:23 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1698