:: [DNG] does systemd set runlevel 0 i…
Forside
Slet denne besked
Besvar denne besked
Skribent: tilt!
Dato:  
Til: dng
Emne: [DNG] does systemd set runlevel 0 in utmp on shutdown?
Hi,

I use xfce-session with nodm, a (very) lightweight display manager.
It essentially puts a user's x session into an endless loop.

When shutting down the system via logout dialog (utilizing pm-utils),
at least on my installation (utilizing sysvinit), nodm fails to
recognize that the system is in shutdown and restarts xfce-session
after xfce-session has received SIGTERM from the shutdown procedure.

I have fixed this behavior by letting nodm evaluate utmp to determine
if the current runlevel is 0, and if yes, not restart the x session.

According to documentation at [1], systemd also has some capability
of writing utmp updates; the documentation explicitly mentions
"runlevel changes and shutdown". I wonder:

Does systemd write RUN_LVL utmp entries in a compliant fashion;
especially, when entering shutdown, does it generate an entry of
ut_type RUN_LVL with ut_pid set to 0?

Kind regards,
T.

Links:

[1] freedesktop.org. systemd-update-utmp.service.
URL:
http://www.freedesktop.org/software/systemd/man/systemd-update-utmp.service.html