首页 > 上网技巧 > 电脑小技巧 > workman项目设置开机自启动

workman项目设置开机自启动

时间:2018-10-30 11:15 作者:QQ地带 我要评论

1.脚本编写
1.2.脚本前三行注释是注册服务所必须的,可以改参数,设置好php安装路径,项目跟路径,启动文件即可
#!/bin/bash
#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 
 
 
 

标签: workman
顶一下
(0)
0%
踩一下
(0)
0%

Google提供的广告