#948346 xdm gets killed, but only on sunday, on the first startup (code=killed, signal=USR2)

Package:
xdm
Source:
xdm
Description:
X display manager
Submitter:
Johan Laenen
Date:
2026-10-08 19:37:36 UTC
Severity:
important
Tags:
#948346#5
Date:
2020-01-07 16:13:16 UTC
From:
To:
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 :(

#948346#10
Date:
2020-01-08 00:15:37 UTC
From:
To:
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

#948346#15
Date:
2020-08-04 08:49:17 UTC
From:
To:
The attached seems to work on buster.
--
Regards,
ASK

#948346#20
Date:
2021-01-10 11:10:16 UTC
From:
To:
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.

#948346#27
Date:
2021-01-25 05:15:35 UTC
From:
To:
Could you make an upload to DELAYED instead of further waiting?

Thanks
Adrian

#948346#32
Date:
2021-01-25 18:34:34 UTC
From:
To:
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.

#948346#37
Date:
2021-02-08 00:43:52 UTC
From:
To:
* Eduard Bloch <edi@gmx.de> [210208 00:43]:

That upload somehow did not make it into the archive?

Chris

#948346#42
Date:
2021-02-08 08:41:17 UTC
From:
To:
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.

#948346#49
Date:
2021-02-08 08:50:29 UTC
From:
To:
No.

Cheers,
Julien

#948346#60
Date:
2021-08-05 00:01:56 UTC
From:
To:
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.

#948346#65
Date:
2021-11-20 15:49:19 UTC
From:
To:
Hi,

I had this problem too, and worked around it:

Configure logrotate /etc/logrotate.d/xdm remove weekly and put
size=1G
 

#948346#70
Date:
2024-08-25 06:17:27 UTC
From:
To:
Greetings,

Johan

#948346#75
Date:
2026-10-08 19:34:58 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
xdm, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 948346@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Boyuan Yang <byang@debian.org> (supplier of updated xdm package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Thu, 08 Oct 2026 15:10:06 -0400
Source: xdm
Architecture: source
Version: 1:1.1.17-4
Distribution: unstable
Urgency: medium
Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
Changed-By: Boyuan Yang <byang@debian.org>
Closes: 655753 869773 909639 924793 948346 950393 1041768 1129528
Changes:
 xdm (1:1.1.17-4) unstable; urgency=medium
 .
   * debian/xdm.postinst.in: Use --pidfile for the running-daemon check.
     (Closes: #1041768, #924793)
   * debian/xdm.init:
     - Handle stop failures without exiting before checking the result;
       keep the pid file on timeout or command errors and return failure.
     - Set HOME=/root for the daemon and X server. (Closes: #1129528)
     - Honour the text kernel command-line option using the C locale for the
       whitespace match. (Closes: #655753)
   * debian/patches/22_systemd_service.diff: Use the display-manager.service
     alias and drop the obsolete default-display-manager pre-start check.
     Only auto-start the selected, unmasked service from postinst and
     postrm abort-upgrade.
     (Closes: #950393)
   * debian/patches/1001-do-not-log-unknown-usernames.patch: Hide login input
     that does not resolve to an account, retaining known usernames in failure
     logs. Adapt Julien Cristau's proposal with a NULL check before getpwnam.
     (Closes: #869773)
   * debian/xdm.logrotate: Use copytruncate instead of signalling xdm during
     startup; keep the log inode used by the daemon and its children.
     (Closes: #948346)
   * debian/xdm.README.Debian: Correct the configuration file descriptions
     and document service selection, text boots, recovery, empty passwords
     and log rotation. (Closes: #909639)
   * debian/control: Actually bump debhelper compat to 14 (the -3 changelog
     claimed this, but the dependency was still 13); drop automatically
     supplied relationship substvars.
   * debian/control, debian/rules: Explicitly require libxpm-dev and enable
     XPM logos instead of relying on an indirect build dependency.
   * debian/xdm.install: Use native debhelper environment substitution;
     remove the dh-exec shebang, executable bit and build dependency.
   * debian/watch: Convert to version 5 format.
Checksums-Sha1:
 debd867d3b95f7eabbe0170c679ae1ab5fa576b1 2632 xdm_1.1.17-4.dsc
 cd79d094a2002659fb2de5e8f94592783b23f391 425804 xdm_1.1.17.orig.tar.xz
 d12e07bca058b05b2e8f9625794ffd9d1098a7a1 60360 xdm_1.1.17-4.debian.tar.xz
 072d6c0b9d8b328dc0383e87fae45b7782885796 7667 xdm_1.1.17-4_amd64.buildinfo
Checksums-Sha256:
 a46495f7dd6a1017a12966a2c97ca4ca01b1a2c98d23a51320ac0f687dba7716 2632 xdm_1.1.17-4.dsc
 9494aef0911a031c53670725b5c8c9bb9d3f7c5ea7318b1f72ddd9dcbbeceb6a 425804 xdm_1.1.17.orig.tar.xz
 6268be57739d0252e68e584a224454fb09d8cafa1cc31c95d88ccf042599089b 60360 xdm_1.1.17-4.debian.tar.xz
 c13e235f92d23421f72c5bd4c2611cf958128e978d7eae02bacabba1ab186395 7667 xdm_1.1.17-4_amd64.buildinfo
Files:
 407d183385f5691e72e2e93dce364610 2632 x11 optional xdm_1.1.17-4.dsc
 e918d273f714098fb409457e37d328ce 425804 x11 optional xdm_1.1.17.orig.tar.xz
 acaa8bc9e321b88f6b1ff5603465ae66 60360 x11 optional xdm_1.1.17-4.debian.tar.xz
 18b305111970537dfe5de869a8532217 7667 x11 optional xdm_1.1.17-4_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEfncpR22H1vEdkazLwpPntGGCWs4FAmrH648ACgkQwpPntGGC
Ws7Lrg//fsUKKGjn1/Vq9ZxmDLkBN4zZG7nxkUPDhcOvpPy1y5QLdbD0IdeWm9ee
YJLWF2yK3q23DRDfrB4OhY4k/Mg25Mh4hLGdVtSz0kOf9dKtUQpYdAvW1BCTA3eB
Y51lhaM1bnWwzV+hUJKaNwwcqR8LUSNyyLXWVnqgWQo7Y1tAGhnXR7Wzezw9OXER
1QuITADSp4ekQ27GPjigpDzhfjHKJyCSMwVoSRO/3de7CqVyj9s7tQEZ9dHGssQh
4V3JqeKIveBFP1m0ZEvqM9lT1Vi/EaB7+G2MKhM/mKReE7o+isvAZ5H8Jh8AEvpr
40OGXfba9OJRcySqnj8CcupEFjqv8zCUaJCzWXzDyHSlx2gG/pdUxDK7eU2VouRI
711QrGPuPO/96GQlZg/NLFTrumffi4uC6IwW4jnD03oJo6QfoFkxaKnsrQjMe0Ex
Q6mWr/cznlBmmUL9EvhGuQ5y/ZWFWOqMn5kkRwha7aoz/FgO1JGn5FXFrn67jOC8
KIawrnrqJt3Qo5gIjU8USVe/coT9fy2rtrg18wiOZzKLP+JbrLATihh39mqb3X1o
+ROW85vLaxjXbmSdbYohoZu3mIvwOto4vaBZV6kkgpW9YnxMURdkNAC6y3vKHZAQ
pMXmnQVWuwhHggKVnfZL3J8Snwa2UOdJmJA3WJl7nQbZa3IeXWg=
=yuit
-----END PGP SIGNATURE-----