centos7 systemd中service文件怎么写?

想写一个service文件。开机让一个PHP文件跑在系统后台,但是尝试了多次都不成功,请大神帮忙看看是哪里写的不对?
源代码:

[Unit]
Description=cgm
After=network.target php-fpm
[Service]
Type=forking
ExecStart=php /cgm/GatewayWorker/start.php start
ExecReload =php /cgm/GatewayWorker/start.php restart
ExecStop =php /cgm/GatewayWorker/start.php stop
PrivateTmp=true
[Install]
WantedBy=multi-user.target

在SSH命令行下运行PHP程序是类似“php *.php start”这样的命令,为啥这里不行了?
详细错误提示如下:
图片描述

阅读 3.3k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进