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

Cristian Rodríguez crrodriguez at opensuse.org
Fri Sep 27 00:57:13 PDT 2013


El 27/09/13 04:26, Muhammad Shakeel escribió:
> 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?

I wont make it needlessly complicated.. just use ConditionPathExists=<a 
file that is created after install but removed after this first boot 
program is complete>


-- 
"Judging by their response, the meanest thing you can do to people on 
the Internet is to give them really good software for free". - Anil Dash


More information about the systemd-devel mailing list