1.创建文件/usr/lib/systemd/system/httpd.service
[Unit]
Description=The Apache HTTP Server
After=network.target remote-fs.target nss-lookup.target
Documentation=man:httpd(8)
Documentation=man:apachectl(8)
[Service]
Type=simple
ExecStart=/usr/bin/httpd -DFOREGROUND
ExecReload=/usr/bin/httpd -k graceful
ExecStop=/bin/kill -WINCH ${MAINPID}
KillSignal=SIGCONT
PrivateTmp=true
LimitNOFILE=infinity
KillMode=mixed
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target
2.建立链接
ln -s /usr/lib/systemd/system/httpd.service /etc/systemd/system/multi-user.target.wants/
3.重新加载systemctl
systemctl daemon-reload
到此完成,强杀的httpd进程能自己起来了。