Systemd service life cycle
Colin Law
clanlaw at gmail.com
Sun Apr 10 12:23:56 UTC 2016
On 10 April 2016 at 12:08, Tom H <tomh0665 at gmail.com> wrote:
> On Sun, Apr 10, 2016 at 12:15 AM, Ralf Mardorf <silver.bullet at zoho.com> wrote:
>> On Sat, 9 Apr 2016 22:06:43 +0100, Colin Law wrote:
>>>On 9 April 2016 at 21:59, Tom H wrote:
>>>> It's for a unit that doesn't have any active processes after
>>>> ExecStart runs. I've used it for setting up networking and
>>>> firewalling, for example.
>>>
>>> Is not the tunnel an 'active process' though?
>>
>> Systemd considers the oneshot service as active after a process
>> exited, if you use RemainAfterExit=true or RemainAfterExit=yes.
>>
>> A script might execute "ip link set * up; pon" or "dhcpcd *" and
>> then exits. After the script exited PPPoE or DHCP are quasi active, OTOH
>> a connection not necessarily is already established after a script
>> exited with status 0.
>
> Does "RemainAfterExit=yes" make more than a cosmetic difference for
> something like "ip link set * up"?
It makes a difference to what happens if you issue another start. If
Remain is set then the start will do nothing as it is still active, if
not then it will start it again. Similarly if you issue a stop then
it will change what happens.
Colin
More information about the ubuntu-users
mailing list