正确的sh脚本,拷贝到 init.d
2011-11-04 15:54
232 查看
#!/bin/bash
#
#
# rc.single This file is executed by init when it goes into runlevel
# 1, which is the administrative state. It kills all
# deamons and then puts the system into single user mode.
# Note that the file systems are kept mounted.
#
# Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
# Modified for RHS Linux by Damien Neil
#
#chkconfig:345 61 61 //此行的345参数表示,在哪些运行级别启动,启动序号(S61);关闭序号(K61)
#description:lionzl //此行必写,描述服务.
case "$1" in
start)
/downloads/a
;;
esac
start()
{
echo "start a"
/downloads/a &
exit 0;
}
stop()
{
kill -9 a
echo "stop a"
}
case "$1" in
start)
start
;;
stop)
stop
;;
esac
exit 0
#
#
# rc.single This file is executed by init when it goes into runlevel
# 1, which is the administrative state. It kills all
# deamons and then puts the system into single user mode.
# Note that the file systems are kept mounted.
#
# Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
# Modified for RHS Linux by Damien Neil
#
#chkconfig:345 61 61 //此行的345参数表示,在哪些运行级别启动,启动序号(S61);关闭序号(K61)
#description:lionzl //此行必写,描述服务.
case "$1" in
start)
/downloads/a
;;
esac
start()
{
echo "start a"
/downloads/a &
exit 0;
}
stop()
{
kill -9 a
echo "stop a"
}
case "$1" in
start)
start
;;
stop)
stop
;;
esac
exit 0
相关文章推荐
- Android init.rc如何启动service去执行sh脚本
- 写一个脚本checkipadd.sh,判断所输入的参数是否为正确的IP地址,如 果是就输出"This is ip address";如果不是就输出"This is not ip address" (1
- Android 应用通过init.rc启动service去执行具有root权限sh脚本
- 带你走进脚本世界,ijkplayer之【init-ios.sh】脚本分析
- 用shell脚本挂载linux主机拷贝相应文件copy.sh
- Android init.rc如何启动service去执行sh脚本
- 用shell脚本挂载linux主机拷贝相应文件copy.sh
- 用shell脚本挂载linux主机拷贝相应文件copy.sh
- init进程 && 解析Android启动脚本init.rc && 修改它使不启动android && init.rc中启动一个sh文件
- init进程 && 解析Android启动脚本init.rc && 修改它使不启动android && init.rc中启动一个sh文件
- Android init.rc如何启动service去执行sh脚本
- 带你走进脚本世界,ijkplayer之【init-ios.sh】脚本分析
- 自己写的第一个shell脚本 HD_init.sh
- ijkplayer编译脚本分析(一)——init-android.sh
- 用Maven自动生成带有sh和bat启动脚本的java应用
- MySQL调优脚本tuning-primer.sh使用说明
- 从windows拷贝到linux虚拟机中的脚本编码问题
- Nginx启动脚本/etc/init.d/nginx
- crontab 执行脚本***.sh 方法