I have the following systemctl service
Code:
[Unit]
Description=The Apache HTTP Server for foobar
After=network.target remote-fs.target nss-lookup.target
Documentation=man:httpd(8)
Documentation=man:apachectl(8)
[Service]
Type=notify
EnvironmentFile=/etc/sysconfig/httpd
ExecStart=/usr/sbin/httpd -f /etc/httpd/conf.d/httpd.foobar.conf
ExecReload=/usr/sbin/httpd -f /etc/httpd/conf.d/httpd.foobar.conf -k graceful
ExecStop=/bin/kill -WINCH ${MAINPID}
# We want systemd to give httpd some time to finish gracefully, but still want
# it to kill httpd after TimeoutStopSec if something went wrong during the
# graceful stop. Normally, Systemd sends SIGTERM signal right after the
# ExecStop, which would kill httpd. We are sending useless SIGCONT here to give
# httpd time to finish.
KillSignal=SIGCONT
PrivateTmp=true
[Install]
WantedBy=multi-user.target
the service fails with a timeout:
systemctl status httpd_foobar.service
â httpd_foobar.service - The Apache HTTP Server for foobar
Loaded: loaded (/usr/lib/systemd/system/httpd_foobar.service; disabled; vendor preset: disabled)
Active: failed (Result: timeout) since Tue 2016-02-09 15:52:06 CET; 21min ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 23622 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 23620 ExecStart=/usr/sbin/httpd -f /etc/httpd/conf.d/httpd.foobar.conf (code=exited, status=0/SUCCESS)
Main PID: 23620 (code=exited, status=0/SUCCESS)
Feb 09 15:50:36 web7 systemd[1]: Starting The Apache HTTP Server for foobar...
Feb 09 15:50:36 web7 kill[23622]: kill: cannot find process ""
Feb 09 15:50:36 web7 systemd[1]: httpd_foobar.service: control process exited, code=exited status=1
Feb 09 15:52:06 web7 systemd[1]: httpd_foobar.service stop-sigterm timed out. Killing.
Feb 09 15:52:06 web7 systemd[1]: Failed to start The Apache HTTP Server for foobar.
Feb 09 15:52:06 web7 systemd[1]: Unit httpd_foobar.service entered failed state
is it something related to selinux?
when i restart manually via the command line:
it works but not when trying via systemctl.