不灭的焱

革命尚未成功,同志仍须努力

作者:php-note.com  发布于:2019-10-11 23:29  分类:Linux软件安装/优化  编辑

可以把 需要设置为开机自执行的脚本放到 配置文件:/etc/rc.local ,参考内容如下:

/etc/rc.local

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

/etc/init.d/nginx start
/alidata/server/php/sbin/php-fpm -c /alidata/server/php/etc/php.ini -y /alidata/server/php/etc/php-fpm.conf
/etc/init.d/vsftpd start
/alidata/www/go/gocron/run.sh start

 

 

相关文章:

(总结)/etc/rc.d/rc.local 与 /etc/profile .bash_profile .bashrc 文件执行顺序

CentOS中/etc/rc.local和/etc/rc.d/rc.local的区别

CentOS7 /etc/rc.local需要chmod +x /etc/rc.d/rc.local

关于CentOS7中,/etc/rc.d/rc.local失效问题

Ubuntu系统中/etc/rc.local和/etc/init.d/rc.local的区别详解