[systemd-devel] ExecStop required in service file?

Michael D. Berger m.d.berger at ieee.org
Mon Nov 14 07:51:55 PST 2011


On my F16_64, mySrvDaemon is a tcp/ip server involving posix
threads, written in C++.  mySrvDaemon.service:

 [Unit]
 Description=Server Service
 After=syslog.target network.target

 [Service]
 PIDFile=/var/lock/subsys/mySrvDaemon
 Type=simple
 ControlGroup=cpu:/
 ExecStart=/usr/sbin/mySrvDaemon --daemon
 ExecStop=/bin/kill -TERM $MAINPID

 [Install]
 WantedBy=multi-user.target

Originally, I did not have the ExecStop line.  But in
that case, shutdown hangs up near the beginning.  The
only way out is to power down.  BTW, the TERM signal
is intercepted by mySrvDaemon and does an immediate
exit(0).

The lockup occurs even if I do:
   systemctl stop mySrvDaemon
   ps -ef | grep mySrvDaemon | grep -v grep
   # it seems to be gone
   reboot
   # lockup

So, at least in this case, the ExecStop line eems to
be required.  What do you think about this?

Thanks,
Mike.

--
Michael D. Berger
m.d.berger at ieee.org
http://www.rosemike.net/



More information about the systemd-devel mailing list