workman项目设置开机自启动
Posted waw
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了workman项目设置开机自启动相关的知识,希望对你有一定的参考价值。
https://blog.csdn.net/xxq929604980/article/details/78558317
http://man.linuxde.net/chkconfig
1.脚本编写
1.2.脚本前三行注释是注册服务所必须的,可以改参数,设置好php安装路径,项目跟路径,启动文件即可
-
-
#chkconfig:2345 90 10
-
#description:activitytask service
-
#processname:activitytask
-
-
php=/usr/bin/php
-
root_path="/vagrant/activity_task/"
-
start_file="web_start.php"
-
case "$1" in
-
start)
-
echo ‘starting activity_task web_start.php‘
-
echo "$php ${root_path}${start_file} start -d"
-
$php ${root_path}${start_file} start -d
-
;;
-
stop)
-
echo "stoping activity_task...web_start.php"
-
echo "$php ${root_path}${start_file} stop"
-
$php ${root_path}${start_file} stop
-
;;
-
-
status)
-
echo "status activity_task...web_start.php"
-
echo "$php ${root_path}${start_file} status"
-
$php ${root_path}${start_file} status
-
;;
-
-
restart)
-
echo "restarting activity_task...web_start.php"
-
echo "$php ${root_path}${start_file} reload"
-
$php ${root_path}${start_file} reload
-
;;
-
*)
-
-
echo "Usage: $0 {start|stop|restart|restart}"
-
-
exit 1
-
-
;;
-
-
-
esac
1.2 配置开机自启动
1.配置文件可执行,chmod +x service_name(假设脚本文件命名为service_name)
2.设置服务的运行级别,默认2345.所以选择默认即可。
chkconfig service_name on
--------------------- 本文来自 带风带不走 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/xxq929604980/article/details/78558317?utm_source=copy
以上是关于workman项目设置开机自启动的主要内容,如果未能解决你的问题,请参考以下文章