[systemd-devel] Shutdown a specific service in systemd shutdown

Mantas Mikulėnas grawity at gmail.com
Sun May 22 19:08:48 UTC 2016


On Sun, May 22, 2016 at 3:24 PM, Andrei Borzenkov <arvidjaar at gmail.com>
wrote:

> 19.05.2016 11:57, Martin Pitt пишет:
> > Hello Bao,
> >
> > Bao Nguyen [2016-05-19 15:52 +0700]:
> >> When the system is shutdown, systemd will terminate all services in
> >> parallel manner, could you let me know if there is any ways to tell
> systemd
> >> to shutdown a specific service first, then shutdown all remaining
> services?
> >
> > The concept of "first"/"last" has no well-defined meaning in any
> > non-serial init systems (not even SysV init with insserv, only with
> > classic SysV init with manually set priorities). I've heard requests
> > like "but this needs to be started as the last thing" a lot in the
> > recent years, and there's no way all the services can simultaneously
> > be "last" :-)
> >
>
> Well, the very good example of service that has to be started/stopped
> before/after anything else is splash screen (plymouth or anything). It
> really must appear as soon as user hit ENTER in "systemctl reboot". As
> it stands now, there is no way to ensure it.
>

Even before the user's session exits? Seems odd.


> > You should put sufficient After= properties into your service, so that
> > it gets started after and stopped before the ones you specify.
>
> Do you suggest adding dependency on plymouth to *every* service?


The "start" half of this problem seems to have been solved already –
various display managers (e.g. gdm and even agetty) have added explicit
support for connecting to Plymouth and telling it to exit.

-- 
Mantas Mikulėnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160522/f35f0432/attachment-0001.html>


More information about the systemd-devel mailing list