Scott,

I too wrote a startup script for systemd.  Your script may be better than mine , but I'll post it as another example.

# cat /usr/lib/systemd/system/listserv.service
[Unit]
Description=LISTSERV startup script
After=syslog.target network.target postfix.service

[Service]
ExecStart=/listserv/go bg
ExecReload=/listserv/go bg
ExecStop=/usr/bin/kill `/usr/bin/cat /listserv/spool/listserv.PID`
PIDFile=/listserv/spool/listserv.PID
Type=simple
RemainAfterExit=yes
User=listserv
Group=listserv

[Install]
WantedBy=multi-user.target

-Rich H
Consultant,
Concordia University System

From: LISTSERV Site Administrators' Forum [mailto:[log in to unmask]] On Behalf Of Scott Kraczek
Sent: Thursday, September 22, 2016 4:22 PM
To: [log in to unmask]
Subject: systemd registration of listserv on modern Linux

Howdy,

I tried dropping the L-Soft provided sysV script into /etc/init.d on my new RHEL7 listserv server, but found that stopping the service under systemd failed to kill all the  ./lsv processes like it used to on RHEL5, leaving two ./lsv zombies to get in the way of maintenance operations. In general, killing the main Listserv PID as recommended by L-Soft just doesn't seem to kill Listserv anymore:

kill `cat $LSVHOME/spool/listserv.PID`


Since I couldn't find a reliable method to kill listserv all the way from the PID, I tried using the lcmd  tool to issue a clean SHUTDOWN command to listserv. I couldn't convince listserv that root was authorized to run commands without making root@hostname a quiet, hidden Admin. Eventually I was able to convince lcmd to shutdown listserv, but I'm not sure if this is the best way.

Since I was re-writing the init script, I figured I might as well learn systemd. I came up with the following systemd unit file, (which relies on root@hostname to be a Listserv admin):

[Unit]
Description=Listserv mailing lists by LSoft
After=network.target postfix.service

[Service]
PIDFile=/home/listserv/spool/listserv.PID
ExecStart=/home/listserv/go bg
ExecReload=/home/listserv/go bg
KillMode=process
Restart=on-failure
RestartSec=42s
ExecStop=/usr/local/bin/lcmd  SHUTDOWN

[Install]
WantedBy=multi-user.target


Anyone have a better, more reliable way to register Listserv under systemd?

Scott K
IT Engineer, BYU


________________________________

To unsubscribe from the LSTSRV-L list, click the following link:
http://peach.ease.lsoft.com/scripts/wa-PEACH.exe?SUBED1=LSTSRV-L&A=1

############################

To unsubscribe from the LSTSRV-L list:
write to: mailto:[log in to unmask]
or click the following link:
http://peach.ease.lsoft.com/scripts/wa-PEACH.exe?SUBED1=LSTSRV-L&A=1