workerman centos 7 开机自动启动
第一步:
vim /lib/systemd/system/workerman.service
第二步:复制以下代码保存退出,注意修改你的workerman路径
[Unit] Description=workerman After=network.target [Service] Type=forking ExecStart=/usr/bin/php /workerman/chat/start.php start -d ExecReload=/usr/bin/php /workerman/chat/start.php restart ExecStop=/usr/bin/php /workerman/chat/start.php stop PrivateTmp=true RemainAfterExit=yes [Install] WantedBy=multi-user.target
第三步:启动服务
systemctl start workerman.service
第四步:查看服务状态
systemctl status workerman.service
第五步:开机启动
systemctl enable workerman.service