Last active
December 15, 2015 10:53
-
-
Save tvrcgo/5567755a134214da8292 to your computer and use it in GitHub Desktop.
tengine manage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
DESC="tengine daemon" | |
NAME=nginx | |
DAEMON=/usr/local/tengine/sbin/nginx | |
CONFIGFILE=/usr/local/tengine/conf/nginx.conf | |
PIDFILE=/usr/local/tengine/logs/tengine.pid | |
SCRIPTNAME=/etc/init.d/tengine | |
set -e | |
[ -x "$DAEMON" ] || exit 0 | |
do_start() { | |
$DAEMON -c $CONFIGFILE || echo -n "tengine already running" | |
} | |
do_stop() { | |
kill -INT `cat $PIDFILE` || echo -n "tengine not running" | |
} | |
do_reload() { | |
kill -HUP `cat $PIDFILE` || echo -n "tengine can't reload" | |
} | |
case "$1" in | |
start) | |
echo -n "Starting $DESC: $NAME" | |
do_start | |
echo "." | |
;; | |
stop) | |
echo -n "Stopping $DESC: $NAME" | |
do_stop | |
echo "." | |
;; | |
reload|graceful) | |
echo -n "Reloading $DESC configuration..." | |
do_reload | |
echo "." | |
;; | |
restart) | |
echo -n "Restarting $DESC: $NAME" | |
do_stop | |
do_start | |
echo "." | |
;; | |
*) | |
echo "Usage: $SCRIPTNAME {start|stop|reload|restart}" >&2 | |
exit 3 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment