[systemd-devel] At wits end... need to execute a script prior to anything getting killed/changed on reboot/shutdown

Lennart Poettering lennart at poettering.net
Thu Jan 17 20:42:46 UTC 2019


On Do, 17.01.19 14:35, Christopher Cox (ccox at endlessnow.com) wrote:

> On 1/17/19 2:25 PM, Lennart Poettering wrote:
> > On Do, 17.01.19 12:38, Christopher Cox (ccox at endlessnow.com) wrote:
> >
> > > > > it defaults to YES and the whole discussions as that changed where about
> > > > > nohup'd processes long ago
> > > >
> > > > Changing it to "no"... I'll let you know if this fixes things or not.
> > > >
> > >
> > > Actually, as it turns out the nohup'd processes are all owned by root, so
> > > changing to "no" didn't fix, but it's my understanding that if the setting
> > > isn't set root is always excluded anyhow.
> >
> > The sessions of root are excluded, which is semantically slightly
> > different from processes of root.
> >
> > > Out of the 18 processes that are
> > > running, my script only sees 6 of them.  Again, it's just doing a "ps -ef"
> > > to a file.  All 18 processes exist prior to shutdown and the script shows
> > > that if I run  manually.
> >
> > Which systemd version is this? Note that on old systemd versions
> > systemd-user-sessions.service would go on its own killing spree early
> > on. Maybe you have such an old version?
>
> Quite possible.  This is CentOS 7.6 using what it calls "systemd-219-62"

So, if you order your service After=systemd-user-sessions.service,
does that change things?

Lennart

--
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list