[systemd-devel] failure to disable a servie from restarting
Paul Wouters
pwouters at redhat.com
Sun Jan 13 13:57:54 PST 2013
On 01/12/2013 04:33 PM, Zbigniew Jędrzejewski-Szmek wrote:
> On Fri, Jan 11, 2013 at 08:20:45PM +0100, Reindl Harald wrote:
>>
>>
>> Am 11.01.2013 19:47, schrieb Paul Wouters:
>>> So the daemon restarts all the time. So let's tell systemd to disable
>>> it, while leaving the service running:
>>>
>>> [root at west ~]# systemctl disable ipsec.service
>>> [root at west ~]# pidof pluto
>>> 1992
>>> [root at west ~]# killall -9 pluto
>>> [root at west ~]# pidof pluto
>>> 2095
>>>
>>> So I guess the man page is either lying or the disasble command is not
>>> working as expected.
> The part that you quoted even explicitly says that 'systemctl disable'
> has no effect on the running system!
I interpreted that as "from now on, systemd will not restart the
service, but it will not stop the running service". So that when I
manually killed the daemon, I expected it to _not_ start it.....
>> "systemctl stop ipsec.service" is your friend NOT disable
But I don't want to _stop_ the service. I want the running service to
not restart when/if it dies.
>> disable controls if the service is started at boot or not
>> and has logically no effect on a running service because
>> "systemctl disable httpd.service" does usually not mean
>> "stop it now", it means "start it not on the next boot"
>>
>> why?
>> because you can "systemctl start" a service which is not enabled
>> at all and if it contains "Restart=always" you normally expect
>> it to get restartet
>
> Also see http://0pointer.de/blog/projects/three-levels-of-off.html .
That page does not really show me an option on how to prevent a restart
_from now on_,
Since this still does not work:
systemctl disable ipsec.service
systemctl stop ipsec.service
systemctl start ipsec.service
This causes the restart behaviour to restart it again.
So my original question still is, can i temporarily disable
Restart=always without changing the service file on disk and sending a
system-daemon reload?
Paul
More information about the systemd-devel
mailing list