SUSE Linux 10下使用rc.local的小窍门


在SUSE Linux 10中并没有rc.local,想使用它就得自己写一个rc script 档案放置于/etc/init.d/ 目录内,然后使用 chkconfig or inssev 程式来管理配置。下面小编就跟大家讲讲具体的操作步骤吧。

方法一:

1.编辑/etc/init.d/rc脚本,在最后一个exit 0之前,加入以下内容:

rc_local=/etc/rc.d/rc.local

current_runlevel=$(runlevel | awk '{ print $NF }')

if [ -x $rc_local ];then

((current_runlevel>1)) && ((current_runlevel<6)) && {

echo -e "\n\n\n"

echo "-----------------------Startup $rc_local---------------------------"

$rc_local

}

fi

以上为脚本内容

2.然后创建/etc/rc.local文件,并赋予755权限:

chmod 0755 /etc/rc.d/rc.local

方法二:

1.创建/etc/rc.d/rclocal文件,加入以下内容:

case "$1" in

start)

if ! test -x /etc/init.d/rc.local ; then

echo '/etc/rc.local is not exsit!'

exit 1

fi

/etc/init.d/rc.local &

;;

stop)

;;

esac

以上为脚本内容

2.创建/etc/rc.d/rc.local,把你要开机执行的脚本都加到里面

3.chmod 0755 /etc/rc.d/rc.local /etc/rc.d/rclocal

4.chkconfig --add rclocal


上一篇:Ubuntu 12.04安装Gnome Shell扩展的方法

下一篇:Linux系统Vsftp 553 Could Not Create File错误如何办?


linuxrc.local suserc.local
Copyright © 2002-2019 测速网 www.inhv.cn 皖ICP备2023010105号
测速城市 测速地区 测速街道 网速测试城市 网速测试地区 网速测试街道
温馨提示:部分文章图片数据来源与网络,仅供参考!版权归原作者所有,如有侵权请联系删除!

热门搜索 城市网站建设 地区网站制作 街道网页设计 大写数字 热点城市 热点地区 热点街道 热点时间 房贷计算器