[systemd-devel] failure to disable a servie from restarting

Lennart Poettering lennart at poettering.net
Wed Jan 16 08:09:21 PST 2013


On Mon, 14.01.13 02:22, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:

> > But I don't want to _stop_ the service. I want the running service
> > to not restart when/if it dies.
> There's a dbus property
>   readonly s Restart
> exposed for units. It would serve your usecase perfectly to make it
> writable. Alas.

This wouldn't really work, as the next "systemctl daemon-reload" would
drop the field again...

> A solution for now could be to
> 'sed s/Restart=yes/Restart=no/ ipsec.service > /run/systemd/systemd/ipsec.service'
> and 'systemctl daemon-reload'. The changes will go away at next
> reboot. (This will only work if you install files into
> /usr/lib/systemd/system and not /etc/systemd/system, since the latter
> once take precedence.)

Yeah, this is kinda the same solution I proposed here:

https://bugzilla.redhat.com/show_bug.cgi?id=807897

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list