您的位置:首页 > 运维架构 > Linux

linux添加开机启动脚本

2016-07-18 17:11 513 查看

在/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**


保存并退出;

再重启动测试下,则在其它的程序都启动完成后,将启动脚本;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  linux