前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >开机启动某脚本,开机启动 workerman 项目,Centos7 开机自动执行脚本

开机启动某脚本,开机启动 workerman 项目,Centos7 开机自动执行脚本

原创
作者头像
OwenZhang
发布2022-06-24 10:38:00
2.1K0
发布2022-06-24 10:38:00
举报
文章被收录于专栏:Owen's WorldOwen's World

第一步创建脚本文件

vim /etc/rc.d/init.d/restart-php.sh

代码语言:javascript
复制
#!/bin/sh
#chkconfig: 2345 10 90
#description: restart-php

cd /www/wwwroot/song-api
php start.php start -d
cd /www/wwwroot/chong-api
php start.php start -d
cd /www/wwwroot/dian-report
php start.php start -d

第二步添加到启动项

增加脚本的可执行权限

chmod +x /etc/rc.d/init.d/restart-php.sh

cd /etc/rc.d/init.d

chkconfig --add restart-php.sh

chkconfig restart-php.sh on

重启看效果

感谢

https://blog.csdn.net/buyueliuying/article/details/87617313

Buy me a cup of coffee :)

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 第一步创建脚本文件
  • 第二步添加到启动项
  • 重启看效果
  • 感谢
  • Buy me a cup of coffee :)
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档