I got a daemon in centos 7 that I'm trying to setup for execution on boot via systemd. The daemon is a binary (c source) that does a fork and change of id/group.
The trouble I'm having is systemd seems to kill the daemon after a timeout period. I'm not sure if it thinks the process did not start correctly or if it's trying to see if it is still active. Anyway here is the status info:
[root@billing init.d]# systemctl status bx_edge.service
bx_edge.service - BillMax Customer Portal Daemon
Loaded: loaded (/etc/systemd/system/bx_edge.service; disabled; vendor preset: disabled)
Active: failed (Result: timeout) since Thu 2016-09-22 00:02:48 UTC; 48s ago
Process: 10611 ExecStop=/bin/pkill edge (code=exited, status=0/SUCCESS)
Process: 10606 ExecStart=/usr/local/billmax/bin/edge -i -o (code=exited, status=0/SUCCESS)
Main PID: 10609 (code=exited, status=0/SUCCESS)
Sep 22 00:01:18 billing.billmax.com systemd[1]: Starting BillMax Customer Portal Daemon...
Sep 22 00:01:18 billing.billmax.com systemd[1]: Started BillMax Customer Portal Daemon.
Sep 22 00:02:48 billing.billmax.com systemd[1]: bx_edge.service stop-sigterm timed out. Killing.
Sep 22 00:02:48 billing.billmax.com systemd[1]: Unit bx_edge.service entered failed state.
Sep 22 00:02:48 billing.billmax.com systemd[1]: bx_edge.service failed.
My service file looks like:
[Unit]
Description=BillMax Customer Portal Daemon
After=network.target
[Service]
ExecStart=/usr/local/billmax/bin/edge -i -o
ExecStop=/bin/pkill edge
Type=forking
[Install]
WantedBy=default.target
What is causing this? I've tried changing the Type value but that results in the same behavior.
Bill