linux开机自动启动脚本放在哪儿

2020-06-07 教育 108阅读

在/etc/rc.local中添加

如果不想将脚本粘来粘去,或创建链接什么的,
则:
step1. 先修改好脚本,使其所有模块都能在任意目录启动时正常执行;
step2. 再在/etc/rc.local的末尾添加一行以绝对路径启动脚本的行;
如:

$ vim /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/rc.d/rc.tune
/opt/pjt_test/test.pl


保存并退出;

声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com