# 进入/etc/init.d/
cd /etc/init.d/
#创建启动脚本
touch start.sh
#编写启动脚本 前三行为必填
vim start.sh
#!/bin/bash
# chkconfig: - 85 15
# description:开机自启脚本<F2>
/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
标签:centos,start,开机,sh,usr,nginx,自启动,chkconfig From: https://www.cnblogs.com/itniwota/p/17965229