#!/bin/sh # # nginx # # chkconfig: 2345 08 92 # description: Starts and stops nginx http server # # config: /etc/sysconfig/firewall # Source function library. ############################################################### # # GRisha , 2006 # . /etc/init.d/functions NAME=nginx LOCK=/var/lock/subsys/$NAME start() { echo -n $"Starting $NAME : " ulimit -SHn 16384 daemon nginx if [ $? -eq 0 ]; then success; echo else failure; echo; return 1 fi touch $LOCK } stop() { echo -n $"Stopping $NAME : " killproc $NAME if [ $? -eq 0 ]; then success; echo else failure; echo; return 1 fi rm -f $LOCK } case "$1" in start) start ;; stop) stop ;; status) status $NAME ;; *) echo $"Usage: $0 {start|stop|status}" exit 1 ;; esac exit 0