Need help with systemd service files

Michal Schmidt mschmidt at redhat.com
Thu Feb 23 15:01:20 UTC 2012


On 02/23/2012 03:35 PM, Juerg Haefliger wrote:
> All services have an [install] section, I just dropped them for this
> email. Forgot to pull in C.target where? Should D.service contain
> "After=rc-local.service C.target" then?

By "pull in" I mean making it included in the transaction. Ordering 
dependencies (such as After) have no effect on that. Only requirement
dependencies can pull units into the transaction. Units that are not in 
the transaction cannot influence the ordering of the transaction.
So you need to add "Wants=C.target" somewhere.

> Rerun using 'systemctl restart' would be nice. So 'RemainAfterExit=y'
> needs to stay, right?

The 'restart' action will work the same in both cases.
It's the 'start' action where the difference can be seen. 'start' won't 
do anything if the service is already active.
The 'restart' action first makes the unit stop (thus making sure it is 
inactive) and then start.

>> Do you want the admin to be able to enable/disable each service separately?
>
> The A-D services don't need to be managed separately, it's either all
> of them or none.

In that case adding Wants makes sense.

May I know what package is this exactly? It's possible we may have 
missed something important by talking in the abstract A,B,C,D terms.

Michal


More information about the devel mailing list