[systemd-devel] How to permanently disable a service after first boot

Muhammad Shakeel muhammad_shakeel at mentor.com
Fri Sep 27 00:26:33 PDT 2013


Hi,

If there is a foo.service which is required to run during first system 
boot then what is the best solution to permanently disable it afterwards?

I can think of two solutions but I am not sure which one is correct/more 
appropriate.

1) ExecStartPost=systemctl disable foo.service (I doubt this will work)
2) ExecStartPost=/bin/rm -f foo.service (this works for me but is this a 
clean solution?)

Is there any flag in for systemd unit files which can be set to run a 
service on first boot only?

Best Regards,
Shakeel


More information about the systemd-devel mailing list