|
发表于 2008-7-16 17:00:15
|
显示全部楼层
#!/bin/sh
#
# A startup script sample
#
# chkconfig: 2345 80 30
DOM_HOME=/home/xxxxxx
DOM_USER=xxxxxx
DOM_PROG=/home/xxxxxx/bin
start() {
echo -n "Starting apachectl.sample: "
su - $DOM_USER -c "$DOM_PROG/apachectl.sample start" > /dev/null 2>&1 &
return 0
}
stop() {
echo -n "Stopping apachectl.sample: "
su - $DOM_USER -c "$DOM_PROG/apachectl.sample stop"
return 0
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: apachectl_sample {start|stop|restart}"
exit 1
esac
试试这个脚本吧,你自己在网上好好找找,类似随机启动脚本比较多. |
|