suse 开机启动问题

sankby sankby 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
suse Linux 11
想添加一个开机启动的脚本执行:
在/etc/init.d新建一个autorun脚本如下,当前的runlevel看了一下是5。
在rc3.d和rc5.d中建了autorun的软连接S99autorun。
使用chkconfig --list autorun 看是
autorun 0:off 1:off 2:off 3:on 4:off 5:on 6:off

chkconfig |grep autorun
autorun 35

chkconfig autorun on
...
insserv: warning: current start runlevel(s) (3 5 6) of script `autorun' overwrites defaults (2 3 4 5).
...
insserv: exiting without changing boot order!
/sbin/insserv failed, exit code 1

reboot 之后:
chkconfig |grep autorun
autorun 35
但是自定义的脚本没有执行,哪位高人帮忙看看是怎么弄的。
晚上查的都是这么搞的,就只启动不了啊。


#! /bin/bash


# Comments to support LSB init script conventions
### BEGIN INIT INFO
# Provides: watchdog
# Required-Start: $local_fs $network $remote_fs
# Should-Start: ypbind nscd ldap ntpd xntpd
# Required-Stop: $local_fs $network $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop watchdog
# Description: watchdog
### END INIT INFO

echo "start watchdog `date`" >dog.txt
PRG="/home/auto.sh"
LOG="/home/alog.txt"

case "$1" in
start)

if [ ! -f $PRG ]; then
echo "programe not exists!" >>$LOG
else
echo "Starting user defined startup programes" "$PRG" >>$LOG
$PRG >>dog.txt
exit 0;
fi
;;
stop)
echo "Stop user defined startup programes, nothing to do here" "$PRG" >>$LOG
;;
restart)

echo "Restart user defined startup programes, nothing to do here" "$PRG" >>$LOG
;;
esac
exit 0
...全文

相关推荐

评论 1
收藏 已收藏
分享
返回顶部
sankby
Linux/Unix社区 18,828 成员 11,488 内容