My O/S is CentOS 7.6 with all updates as of today.
I have a system where many users log in and run GNOME sessions via VNC (xrdp). I do not want idle sessions hanging around forever, so I followed the instructions for enabling automatic logout.
Both sets of instructions are the same: Create
/etc/dconf/db/local.d/00-autologout; set the
sleep-inactive-ac-type keys in the
[org/gnome/settings-daemon/plugins/power] section; run
I did this, setting the timeout to 604800 seconds (1 week). And it works!
Well, except for one thing. The X server on the local console exited one week later, and gdm did not restart it.
This has happened a few times on a few systems now, and only after I enabled the automatic logout mechanism, so I am very certain it is responsible.
The last few lines of my
/var/log/gdm/:0.log file read:
AUDIT: Wed Feb 20 15:15:11 2019: 27188: client 15 disconnected AUDIT: Mon Feb 25 20:56:28 2019: 27188: client 6 disconnected AUDIT: Mon Feb 25 20:56:28 2019: 27188: client 6 connected from local host ( uid=42 gid=42 pid=28256 ) Auth name: MIT-MAGIC-COOKIE-1 ID: 804 AUDIT: Mon Feb 25 20:56:28 2019: 27188: client 6 disconnected [...more "client XX disconnected lines"...] AUDIT: Mon Feb 25 20:56:28 2019: 27188: client 14 disconnected (II) evdev: HID 0557:2419: Close (II) evdev: HID 0557:2419: Close (II) evdev: Power Button: Close (II) Server terminated successfully (0). Closing log file.
/var/log/Xorg.0.log is very similar. No errors; just a clean server shutdown.
ps shows that
/usr/sbin/gdm is still running but has no child processes. The X server for :0 simply exited cleanly and never got restarted.
Logging in and out on the console by hand works fine. And everything is OK if I disable automatic logout, except then I don't have automatic logout.
I am not entirely sure what to try next. If gdm fails to restart the X server after it exits, is that a gdm bug by definition?
I can reproduce this problem, sort of, without using autologout.
If I log in remotely and just kill (-HUP, -INT, -9, whatever) the X server for :0, gdm does not restart it.
But only if nobody is logged in on the console at the time. If anyone is logged in, gdm restarts the X server fine.