Systemd unit file alias question

Lennart Poettering mzerqung at
Thu Dec 15 17:11:33 UTC 2011

On Mon, 21.11.11 15:37, Richard Shaw (hobbes1069 at wrote:

> I'm working on improving how akmods are built and had an idea[1] I
> need input/confirmation on.
> Instead of the akmods packaging assuming when it needs to run, why
> can't each akmod driver package provide it's own unit file?
> Since the service would run as type "oneshot", am I correct in
> assuming that no matter how many times it's started, it will only
> start for real on the first (earliest) occurrence?

No, it will start whenever somebody requests it and it isn't already
running on Type=oneshot. However, if you combine this with
RemainAfterExit=yes you get the desired behaviour.

> My idea is that each akmod driver package would provide a service file
> with the same name as the package but include an alias to
> "akmods.service".

Not sure I understand this. Note that systemd will not allow aliases to
be mapped to multiple units at the same time.

> What's the consequences of multiple unit files claiming the same
> alias? Is this safe?

The first one will win, the others will result in an error message to be
printed and ignored. 


Lennart Poettering - Red Hat, Inc.

More information about the devel mailing list