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

Christopher Cox ccox at endlessnow.com
Thu Jan 17 21:18:43 UTC 2019


On 1/17/19 2:42 PM, Lennart Poettering wrote:
> 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?

I changed it to use After=systemd-user-sessions.service

Did not seem to change the behavior.  Only getting subset in the file 
(this time only 2 of 18 processes).


But, systemctl list-dependencies --after systemd-user-sessions.service, 
doesn't show my service.  Should it?


More information about the systemd-devel mailing list