httpsqs 怎么设置开机自启动

如题所述

第1个回答  2016-04-22
# chkconfig: 3 66 40
# description: httpsqs
# processname: httpsqs
# config:

# Source function library
. /etc/rc.d/init.d/functions

RETVAL=0
prog="httpsqs"
OPTIONS=" -d -x /data/httpsqs/logs/queue "
PPATH="/usr/bin/"
PORT="1218"
IP="6.6.6.6"

start() {
# Start daemons.
[ -x $PPATH$prog ] || \
{ echo "FATAL: No such programme";exit 4; }

echo -n $"Starting $prog: "
daemon $PPATH$prog -p $PORT -l $IP $OPTIONS
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
echo
return $RETVAL
}

stop() {
# Stop daemons.
echo -n $"Shutting down $prog: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
return $RETVAL
}

# call the function we defined
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
RETVAL=$?
;;
status)
status $prog
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 2
esac

exit $RETVAL本回答被网友采纳
相似回答