Hello,
I currently have a systemd unit that I have to reference a lot which has
a rather long name. I would prefer to be able to reference this unit as
a short alias.
Example: I have a container unit called '[email protected]'
and I would like to be able to refer to it as simply 'sd-gitlab.service'
I've added an override.conf with the following:
[Install]
WantedBy= # To clear out previous wantedby params,
though this doesn't seem to work like that. Documentation doesn't say it
should, so I'm not surprised.
Alias=sd-gitlab.service # I've also tried
Alias=machines.target.wants/gitlab.service and omitted the following
WantedBy decl.
WantedBy=machines.target
When I run enable, it does not make the symlinks:
#systemctl enable [email protected]
Created symlink from
/etc/systemd/system/machines.target.wants/[email protected]
to /etc/systemd/system/[email protected]
However, if I edit the [email protected] base unit file
(systemctl edit --full [email protected]) and change the
Install section to:
[Install]
Alias=gitlab.service # Only added this one line
WantedBy=machines.target
and enable the service:
#systemctl enable [email protected]
Created symlink from /etc/systemd/system/gitlab.service to
/etc/systemd/system/[email protected].
Created symlink from
/etc/systemd/system/machines.target.wants/[email protected]
to /etc/systemd/system/[email protected].
Is there a way I can have it only enable the alias of the unit? Or do
both have to be enabled?
Also, is there any way to specify a unit alias within an override.conf?
Thanks in advance!
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel