suse 开机启动问题
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