#!/bin/sh
### the shell program is nginx start!!! 2008-10-23 chunming
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/opt/csw/bin:/var/nginx/sbin
NAME=nginx
DAEMON=/var/nginx/sbin/nginx
PIDFILE=/var/nginx/logs/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
[ -x "$DAEMON" ] || exit 0
do_start()
{
if [ -f $PIDFILE ]; then
echo “Nginx program is runing!!!”
exit 1
else
$DAEMON
echo “Nginx program is the successful start!!! “
fi
}
do_stop()
{
if [ -f $PIDFILE ]; then
kill `cat $PIDFILE`
rm -f $PIDFILE
echo “Nginx program is stoping”
else
echo “Nginx program is not runing!!!”
fi
}
do_reload ()
{
if [ -f $PIDFILE ]; then
kill -HUP `cat $PIDFILE`
echo “Nginx program is reload”
else
echo “Nginx program is not runing!!!”
fi
}
case “$1″ in
start)
do_start
;;
stop)
do_stop
;;
restart)
do_stop
do_start
;;
reload)
do_reload
;;
*)
echo “Usage: $SCRIPTNAME {start|stop|restart|reload}” >&2
;;
esac
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/21041/showart_1333084.html
原创文章,转载请注明: 转载自PT Ubuntu Blog

十一月 7th, 2008
ruijin
Posted in
Tags: 




