[systemd-devel] systemd shutdown query

Susant Sahani susant at redhat.com
Wed Oct 7 20:04:48 PDT 2015



On 10/07/2015 06:03 PM, Colin Guthrie wrote:
> Susant Sahani wrote on 07/10/15 04:05:
>>
>>
>> On 10/06/2015 06:36 PM, Lennart Poettering wrote:
>>> On Mon, 05.10.15 15:49, Dushyant Uge (dushyantu2 at gmail.com) wrote:
>>>
>>>> Hello there,
>>>>
>>>> I have two queries
>>>>
>>>> Some processes terminated immediately after writing reboot before
>>>> reaching
>>>> systemd unit ExecStop
>>>
>>> I am not sure I parse this, but when services are shut down systemd
>>> won't kill their processes until their ExecStop= is executed, so that
>>> the code in the ExecStop= can do that on its own. Everything else would
>>> be a bug.
>> If it's like ExecStop=su  example-user; /sbin/foo .
>> then is it the same behavior ?
>
> That's not a valid ExecStop definition (for one, there is no path to su;
> secondly it contains a ; which isn't doing what you think it does...)
>
> I'd strongly advice against using su, but if you have to you'd have to
> wrap this command in some kind of script:

Actually this is in a script.
>
> e.g. ExecStop=/bin/sh -c '/sbin/su example-user; /sbin/foo .'
>
> But I'd really recommend finding a cleaner way to do this!
>
Susant


More information about the systemd-devel mailing list