swoole http server systemd 脚本

[Unit]
Description=Swoole Http Server
After=network.target
After=syslog.target

[Service]
Type=forking
PIDFile=/run/swoole_xxx.pid
ExecStart=/usr/bin/php /srv/www/xxx/server.php
ExecStop=/bin/kill $MAINPID
ExecReload=/bin/kill -USR1 $MAINPID
Restart=always

[Install]
WantedBy=multi-user.target graphical.target

参考:https://wiki.swoole.com/wiki/page/699.html