jessie systemd shutdown sequence
Hello all,
I'd like to find out more about what the systemd does during shutdown/reboot.
I knew pretty well what old sysVinit does, but my long experience is worthless
with systemd, and I have to learn anything anew :(.
I accept RTFM answers if they include links ;)
The problem I have is partially related to https://bugs.debian.org/cgi-
bin/bugreport.cgi?bug=751636
In my eyes it seems that systemd shuts down everything in parallel, including
networking. So it can stop network quite early, before other services. Thus
SSH connection just hangs, instead of proper disconnect. That can be solved by
installling libpam-systemd - SSH session closes immediately after issuing
reboot.
However I would prefer, that SSH is not stopped until all other services shut
down properly, so that if something goes wrong I can still connect and
investigate or fix it.
As an example - a virtual machine in libvirt/KVM/Qemu, that for whatever
reason ignores the ACPI button, and does not shut down. Yeah systemd will kill
it eventually (5 minutes or so), but I would prefer to log into such machine
and issue correct shutdown. Unfortunately the neworking was gone at that
moment.
Another similar bug (hopefully fixed now), was that bind for some reason did
not shut down on SIGINT/SIGTERM, and the init script was waiting forever.
Without SSH stil active I would have to power cycle the server. (which is a
bit more complicated with remote servers).
So what I would like to achieve is to set somehow the dependencies in systemd,
so that networking is deconfigured only after all services are stopped, and
that SSH is the last service to stop.
Perhaps this should be a bug report against systemd, but I wanted first to
know if I'm not missing something that is obvious for those who know systemd
better.
--
Best Regards
Vladislav Kurz
Reply to: