|Summary:||regression in the 1.18.1 update breaks logfile command line argument when used with displayfd|
|Product:||xorg||Reporter:||Antoine Martin <antoine>|
|Component:||Server/DDX/Xorg||Assignee:||Xorg Project Team <xorg-team>|
|Status:||RESOLVED FIXED||QA Contact:||Xorg Project Team <xorg-team>|
|i915 platform:||i915 features:|
Description Antoine Martin 2016-05-02 06:09:52 UTC
As per: https://bugs.freedesktop.org/show_bug.cgi?id=93212#c5 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.
Comment 1 Antoine Martin 2017-08-05 10:11:47 UTC
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.
Comment 2 Adam Jackson 2018-06-13 19:25:58 UTC
commit c95361465ee98dd97a99778d8a31be88fe9e4c4f 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 this commit: https://cgit.freedesktop.org/xorg/xserver/commit/?id=edcb6426f20c3be5dd5f50b76a686754aef2f64e 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>