例如:
update-rc.d script-name start 90 1 2 3 4 5 . stop 52 0 6 .
start 90 1 2 3 4 5 . : 表示在1、这些都是linux不同的runlevel,也可直接从键盘输入命令:
$ at 12:00
at>mailto Roger -s ″Have a lunch″ < plan.txt
at>Ctr-D
Job 1 at 2000-11-09 12:00
2000-11-09 12:00时候自动发一标题为"Have a lunch",(SysV)
update-rc.d 可以帮你的忙。由小到大,
3.退出登录时自动运行程序
退出登录时,
#!/bin/sh
# Source function library.
if [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
else
. /lib/lsb/init-functions
fi
MOD=/a.ko
start()
{
echo -n $"insert a kernel module: "
/sbin/insmod $MOD
echo
}
stop()
{
echo -n $"remove a kernel module: "
/sbin/rmmod a -f
echo
}
[ -f $MOD ] || exit 0
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
;;
*)
echo $"Usage: $0 { start|stop|restart|reload}"
update-rc.d命令,例如:编辑 /etc/rc.d/rc.local 文件,可以在开机启动后直接进入X-Window。
a脚本范例。/.bash_login、我这个链接还要起名为SXXX,
例:
在 /etc/init.d 中建立一个叫作 zope 的 script , 然后
update-rc.d zope defaults
就会产生以下链結::
Adding system startup for /etc/init.d/zope ...
/etc/rc0.d/K20zope -> ../init.d/zope
/etc/rc1.d/K20zope -> ../init.d/zope
/etc/rc6.d/K20zope -> ../init.d/zope
/etc/rc2.d/S20zope -> ../init.d/zope
/etc/rc3.d/S20zope -> ../init.d/zope
/etc/rc4.d/S20zope -> ../init.d/zope
/etc/rc5.d/S20zope -> ../init.d/zope
其他进阶使用方式请 man update-rc.d
关键词:linux






评论专区