If you launch Xorg with -displayfd and specify the logfile you want to use, the server gets confused, tries to rename the logfile to itself, fails and logs a warning.
The logfile name specified will be created then quickly renamed with the ".old" suffix, which means the filename specified as argument cannot be found.
That's because the code goes through LogFilePrep twice with the same filename.
This new function in 1.18.1 should probably not be used when the "-logfile" command line argument is present.
Maybe there should also be a check to avoid trying to rename the log file if the filename is unchanged. (though that should just not happen if the code is fixed)
To see the problem in action, you can knock up a demonstration using a shell script and an extra file descriptor for displayfd, or just run: "xpra start --no-daemon |& grep Failed" on Fedora or Debian.
Created attachment 133253 [details] [review]
this patch fixes the bug
Don't try to add the pidstring to the log filename if it doesn't contain
the "%s" placeholder for it.
Author: Antoine Martin <firstname.lastname@example.org>
Date: Wed Mar 28 15:16:02 2018 -0400
os: Fix -logfile when used with -displayfd
Trivial way to reproduce the bug:
$ Xorg -logfile /tmp/mylog -config /etc/xpra/xorg.conf -displayfd 2
The server then moans:
Failed to rename log file "/tmp/mylog" to "/tmp/mylog": No such file or directory
And the log file is created but immediately renamed to "/tmp/mylog.old".
This is caused by the changes to the log file handling introduced by
To fix this, only rename the logfile if the log filename contains the
magic substitution string "%s".
Signed-off-by: Antoine Martin <email@example.com>
Reviewed-by: Alan Coopersmith <firstname.lastname@example.org>