[systemd-devel] socket activated services and correct dependency mapping
James Hogarth
james.hogarth at gmail.com
Fri Jul 24 02:38:00 PDT 2015
Hi,
I'm in the process of adding systemd native sockets to a service
(rather than using inetd compatibility) and am trying to get my head
around the proper way to configure the unit files so that the socket
is optional rather than required but allowing restarting of the socket
unit.
https://github.com/yrutschle/sslh/pull/56
[root at hoglaptop ~]# systemctl cat sslh.socket
# /etc/systemd/system/sslh.socket
[Socket]
ListenStream=10.81.60.229:443
ListenStream=10.81.60.229:444
ListenStream=10.81.60.229:445
ListenStream=10.81.60.229:446
ListenStream=10.81.60.229:447
FreeBind=true
[Install]
WantedBy=sockets.target
[root at hoglaptop ~]# systemctl cat sslh.service
# /etc/systemd/system/sslh.service
[Service]
ExecStart=/home/hogarthj/workspace/github-sslh/sslh-fork -v -f --ssh
127.0.0.1:22
KillMode=process
I want a user to be able to systemctl start sslh and use listening
addresses in /etc/sslh.cfg as always (so I'm reluctant to put a
straight Sockets= in the service unit file) but as it stands the lazy
activation of sslh works a treat however once the service is activated
it is listening on the sockets so it's not possible to systemctl
restart sslh.socket to change an IP or add a port without stopping
sslh.service first ...
Is what I'm trying to do flat out a bad idea and impossible or is
there a way of ordering this in such a way that a restart of
sslh.socket stops sslh.service in the process ... or something to
attain the goal of a restartable socket unit and an associated that
has not explicit need of the socket?
Regards,
James
More information about the systemd-devel
mailing list