workman项目设置开机自启动
2017-11-17 10:37
274 查看
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项目设置开机自启动
- linux下设置oracle开机自启动
- 【ROS总结】Turtlebot ROS 开机自启动设置(2)
- 如何将Linux下的应用程序VLC设置为开机自启动?
- Linux下设置MongoDB开机自启动
- ceph存储 CentOS设置程序开机自启动的方法
- CentOS 7安装Mysql并设置开机自启动的方法
- linux设置开机自启动的三种方法
- CentOS Oracle11gR2 设置开机自启动
- Android 代码设置开机自启动App的方法
- 如何设置保证Apache Tomcat服务器开机自启动
- java程序,在windows下设置为开机自启动
- ARM-Linux开机自启动设置-ok6410开发板
- 在服务器上设置mongodb分片集群开机自启动
- 各种桌面环境下设置开机自启动应用程序的方法
- Windows设置开机自启动bat脚本
- CentOS Oracle11gR2 设置开机自启动
- 在openwrt中设置mjpg_streamer开机自启动
- ubuntu下设置开机自启动项
- 设置nexus开机自启动