[systemd-devel] systemd shutdown query

Colin Guthrie colin at mageia.org
Wed Oct 7 05:33:24 PDT 2015


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:

e.g. ExecStop=/bin/sh -c '/sbin/su example-user; /sbin/foo .'

But I'd really recommend finding a cleaner way to do this!

Col

-- 

Colin Guthrie
colin(at)mageia.org
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/


More information about the systemd-devel mailing list