随笔 - 91  文章 - 0  评论 - 0  阅读 - 94254

centos 开机自启动设置

# 进入/etc/init.d/

cd /etc/init.d/

#创建启动脚本

touch start.sh

#编写启动脚本 前三行为必填

vim start.sh

#!/bin/bash
# chkconfig: - 85 15
# description:开机自启脚本
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

# 开启自动方式一:

/usr/lib/systemd/systemd-sysv-install enable start_nginx.sh

 

# 开启自动方式二:

开启

chkconfig start_nginx.sh on

移除

chkconfig   start_nginx.sh off

 chkconfig --del start_nginx.sh

 

posted on   知了不了了之  阅读(136)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· winform 绘制太阳,地球,月球 运作规律
· 上周热点回顾(3.3-3.9)
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示