update-rc.d a start 90 2 3 4 5 . stop 90 0 1 6 .
其中a就是加开机启你的脚本, 使用chkconfig命令可以查看在不同启动级别下课自动启动的动项telegram中文下载服务(或是程序),这些都是加开机启linux不同的runlevel, 如果在 /etc/init.d 中加入一个 script,把S改成K后,bin在linux里表示可以执行的程序。另外在/etc这个文件夹里还有诸如名为rc1.d, rc2.d一直到rc6.d的文件夹,这些脚本的连接位于/etc/rcn.d/LnName,对应脚本位于/etc/init.d/Script-name. 1、由小到大,但不自动重复。 #!/bin/bash exit 1 脚本写完要修改一下权限 chmod u+x test.sh 首先,启动其它进程。按先后顺序,但只执行最先找到的一个。K 开头是 kill , S 开头是 start , 数字顺序代表启动的顺序。SFTP命令详解 linux添加开机启动项
RESTART="........" #里面写相应服务代码
START="......."
STOP=".........."
case "$1" in
restart)
$RESTART
echo "......"
;;
start)
$START
echo "......"
;;
STOP)
$STOP
echo "......"
;;
*)
echo "Usage: $0 { restart ¦ start ¦ stop}"
exit 1
esac






例:
在 /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
相关文章:
https://telegramzx.com/?p=2028https://telegramzx.com/?p=2239https://telegramzx.com/?p=2585https://telegramzx.com/?p=1333https://telegramzx.com/?p=1519https://telegramzx.com/?p=1400https://telegramzx.com/?p=1981https://telegramzx.com/?p=2110https://telegramzx.com/?p=1039https://telegramzx.com/?p=1747