您的位置:首页 > 其它

正确的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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: