[systemd-devel] socket / service dependency
Ken Bass
kbass at kenbass.com
Mon Mar 20 16:38:41 UTC 2017
I thought I followed the instructions (using Centos 7 - I believe
systemd219) ... I am running a local news server (innd.service).
I needed to add an additional inetd style daemon for nnrpd to support
SSL. See files below. Using the BindTo and After seems proper since I
never want nnrpd running unless innd is already started/running. If innd
is stopped, i want to be sure nnrpd is stopped. Initially this worked
fine. But if I stop the innd service, and then start it again, the
nnrpd.socket is not started. How do I handle this?
I created a drop in file for innd with a Before/Wants of nnrpd. This
sometimes works, but normally I get 'Job innd.service/start deleted to
break ordering cycle starting with nnrpd.socket/start'. What is the
proper way to do this.
/etc/systemd/system/innd.d/innd.conf
[Unit]
Before=nnrpd.socket
Wants=nnrpd.socket
Files below:
/etc/systemd/system/nnrpd.socket
[Unit]
Description=nnrpd SSL socket listeners
After=syslog.target network.target
ConditionPathExists=/etc/news/inn.conf
BindsTo=innd.service
After=innd.service
[Socket]
ListenStream=563
Accept=yes
[Install]
WantedBy=multi-user.target
and
/etc/systemd/system/nnrpd at service
[Unit]
Description=nnrpd SSL server
[Service]
User=news
PermissionsStartOnly=true
ExecStart=/usr/libexec/news/nnrpd -p 563 -S
StandardInput=socket
SuccessExitStatus=1
Existing innd.service, as installed from EPEL repo,
[Unit]
Description=InterNet News Daemon
After=syslog.target network.target
ConditionPathExists=/etc/news/inn.conf
[Service]
User=news
PermissionsStartOnly=true
PIDFile=/run/news/innd.pid
Type=forking
ExecStart=/usr/libexec/news/rc.news
ExecStop=/bin/su -m news -c '/usr/libexec/news/rc.news stop'
KillMode=control-group
[Install]
More information about the systemd-devel
mailing list