Dear Maintainer, xdm gets killed on sundays at startup time. It only happens once on sunday. When I delete /var/lib/xdm.pid I can proceed with a xdm restart without any problem. This is what systemd (systemctl status and journalctl -u xdm.service) reports: ● xdm.service - X-Window Display Manager Loaded: loaded (/lib/systemd/system/xdm.service; indirect; vendor preset: enabled) Active: failed (Result: signal) since Sun 2020-01-05 08:30:37 CET; 1min 45s ago Process: 673 ExecStartPre=/bin/sh -c [ "$(cat /etc/X11/default-display-manager 2>/dev/null)" = "/usr/bin/xdm" ] (code=exited, status=0/SUCCESS) Process: 676 ExecStart=/usr/bin/xdm -nodaemon (code=killed, signal=USR2) Main PID: 676 (code=killed, signal=USR2) Jan 05 08:30:31 msi systemd[1]: Starting X-Window Display Manager... Jan 05 08:30:31 msi systemd[1]: Started X-Window Display Manager. Jan 05 08:30:34 msi systemd[1]: xdm.service: Main process exited, code=killed, status=12/USR2 Jan 05 08:30:37 msi systemd[1]: xdm.service: Failed with result 'signal'. -- Logs begin at Sun 2020-01-05 08:30:25 CET, end at Sun 2020-01-05 08:31:56 CET. -- Jan 05 08:30:31 msi systemd[1]: Starting X-Window Display Manager... Jan 05 08:30:31 msi systemd[1]: Started X-Window Display Manager. Jan 05 08:30:34 msi systemd[1]: xdm.service: Main process exited, code=killed, status=12/USR2 Jan 05 08:30:37 msi systemd[1]: xdm.service: Failed with result 'signal'. I have no idea what causes the kill :(
Dear Maintainer,
I could reproduce the issue in a minimal bullseye VM.
From my observations I guess the USR2 signal is sent
by logrotate:
/etc/logrotate.d/xdm:
kill -s USR2 $(cat /var/run/xdm.pid); \
If I read [1] right, then USR2 has a default action of
process termination. Therefore is my guess that log rotation
is started/finishes too fast and the USR2 signal is sent
before xdm replaced the default with its own signal handler.
With a package built with the following line moved near
the top of the main function I could no more
reproduce the issue:
(void) Signal (SIGUSR2, ReopenLogFileNotify);
Kind regards,
Bernhard
[1] https://unix.stackexchange.com/questions/38589/why-does-sigusr1-cause-process-to-be-terminated
The attached seems to work on buster. -- Regards, ASK
Control: severity 948346 serious Thanks for the patch, also thanks to Bernhard for investigation. The patch could be used but it just working around symptoms. I see multiple bugs involved here. a) logrotate job using a plain kill. This is racy, even with SysV init. We can do it better (systemctl kill function). b) service file not cleaning up the pid file. That file should be gone even when service terminates. c) xdm refusing to start when the pid file exists, although the process is no longer running. It could check whether it's still active, and/or maybe just kill it and evaluate the errno. I am setting this to RC severity because it's just NOT ok and obvious to fix. Going to change mentioned things and NMU this in a couple of weeks if there is no further reaction from maintainers. Best regards, Eduard.
Could you make an upload to DELAYED instead of further waiting? Thanks Adrian
Hallo, * Adrian Bunk [Mon, Jan 25 2021, 07:15:35AM]: I am no longer waiting, today is timeout day. Will use 7-DAY DELAYED queue, should be appropriate. Best regards, Eduard.
* Eduard Bloch <edi@gmx.de> [210208 00:43]: That upload somehow did not make it into the archive? Chris
Hallo, * Chris Hofstaedtler [Mon, Feb 08 2021, 01:43:52AM]: Not yet. If you need a patch, please grab the repo from https://salsa.debian.org/xorg-team/app/xdm/-/merge_requests/2 and/or contribute to the MR review. @Julien: okay to add myself as Uploader and upload? And/or do you actually insist on the changes mentioned in the MR? Best regards, Eduard.
No. Cheers, Julien
Vielen Dank für die Informationen, die ich über Ihr Facebook-Profil über Sie erhalten habe. Ich benötige jedoch Ihre Mithilfe, um humanitäre Hilfe zu verteilen, um das Projekt entsprechend finanziell zu arrangieren. Grüße.
Hi, I had this problem too, and worked around it: Configure logrotate /etc/logrotate.d/xdm remove weekly and put size=1G
Greetings, Johan