Start a service if not running live mode

I need to run a service after start up but becayse issues of RAM I can’t run it in live mode.

I need anyway to only run a service if the system is not running in live mode, I’ve been reading the systemctl --user status livecheck.service and the /usr/share/livecheck/livecheck-lsblk but i haven’t come to the conclusion of how i can do it or if it’s possible.

As far I have understood the service run a log of 0 or 1 in a log and that log have to be used by the livecheck service that launch the notification icon, but I wasn’t able to find it.

Any idea or documentation about it?

Something like this should do the trick:

[Unit]
ConditionKernelCommandLine=!rootovl
ConditionKernelCommandLine=!rd.live.overlay.overlayfs=1

Add those keys to the appropriate place in your service’s unit file, or drop the above snippet into the service’s configuration directory (i.e. /usr/lib/systemd/system/my.service.d, replacing my.service as appropriate) if you didn’t write the service yourself. See:

1 Like