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

Andrei Borzenkov arvidjaar at gmail.com
Sun Jan 27 06:39:58 UTC 2019


17.01.2019 21:03, Christopher Cox пишет:
> On 1/17/19 11:59 AM, Lennart Poettering wrote:
>> On Do, 17.01.19 11:17, Christopher Cox (ccox at endlessnow.com) wrote:
>>
>>>>> [Install]
>>>>> WantedBy=multi-user.target
>>>>>
>>>>> In my case, my script rolls through the currently running
>>>>> processes, looking
>>>>> for certain ones, determines listening port (ss) and gets the time the
>>>>> process was started (stat) and outputs info to a file.
>>>>>
>>>>> What I'm seeing is a file at shutdown that does not contain all the
>>>>> processes.
>>>> Hmm, what kind of processes are you missing? user session stuff? How
>>>> do you shut down? Note that display managers are likely to terminate
>>>> the user sessions first, and only initiate system shutdown then...
>>> These are nohup'd background processes not tied to any tty.
>> Well, how is that stuff started? Note that if systemd --user or
>> --system manages your process then it will keep track of it through
>> cgroups, and "nohup" is not a concept for evading that.
> 
> Nohup'd processes started by an ssh as a user.  Process "parent" pid 1.
> 

And they belong to which control group (i.e. service)?

What dependencies this service has?


More information about the systemd-devel mailing list