[systemd-devel] Alias use in socket file

Lennart Poettering lennart at poettering.net
Tue Sep 8 14:04:33 UTC 2020


On Di, 08.09.20 08:45, Belisko Marek (marek.belisko at gmail.com) wrote:

> Hi,
>
> I'm using yocto build systemd and I'm using openssh server which
> create sshd.socket + sshd at .service files. With socket I can control if
> ssh is enabled / disabled. I have an application which expects to
> check statu of ssh.service. I tried to add Alias=ssh.service to
> sshd.socket file and tried systemd enable sshd.socket but systemd
> cannot see ssh.service. Is there some other way to create a link to an
> existing socket file? Thanks

No, systemd refuses to recognize unit symlinks that change unit type
(i.e. the unit suffix after the dot) as aliases. It also doesn't
accept symlinks that change if a unit is templated or not. Objects
can't magically change their type, and they cannot suddenly
become/stop being templated or not.

Sorry,

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list