coffee_cn

博客园 首页 新随笔 联系 订阅 管理

1、准备文件:coffeetest.service

# copy to /usr/lib/systemd/system
# systemctl enable coffeetest.service
[Unit]
Description=coffeetest Service

[Service]
Type=forking
User=root
ExecStart=/etc/init.d/coffeetest.sh

[Install]
WantedBy=multi-user.target

2、准备文件:coffeetest.sh

#!/bin/bash
nohup /usr/bin/php /myproject/coffeetest.php >> /myproject/logs/coffeetest.log 2>&1 &

拷贝到目录:/etc/init.d

posted on 2018-12-11 18:20  coffee  阅读(1371)  评论(0编辑  收藏  举报