Sha256: 05aefabef766952753f0d54277bd4176d512a70815fa0992b684e665ae5fe247

Contents?: true

Size: 1.63 KB

Versions: 16

Compression:

Stored size: 1.63 KB

Contents

#!/bin/sh

#This is a start script for nginx. Tested on Unbuntu Edge. 
#Should work on Ubuntu, Debian and probably a few other Linux distros.
#Change DAEMON and CONFIG_FILE  if neccessary

PATH=/sbin:/bin:/usr/sbin:/usr/bin


#Location of nginx binary. Change path as neccessary
DAEMON=/usr/sbin/nginx
# DAEMON=/usr/local/nginx/sbin/nginx
#Location of configuration file. Change path as neccessary
CONFIG_FILE=/etc/nginx/nginx.conf
# CONFIG_FILE=/usr/local/nginx/conf/nginx.conf


DAEMON_OPTS="-c $CONFIG_FILE"
NAME=nginx
DESC="web server"
PIDFILE=/var/run/$NAME.pid 
SCRIPTNAME=/etc/init.d/$NAME


#only run if binary can be found
test -x $DAEMON || exit 0

set -e

#import init-functions
. /lib/lsb/init-functions

case "$1" in
start)
log_daemon_msg "Starting $DESC" $NAME
if ! start-stop-daemon --start --quiet\
    --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS ; then
    log_end_msg 1
    else
    log_end_msg 0
fi
;;
stop)
log_daemon_msg "Stopping $DESC" $NAME
if start-stop-daemon --quiet --stop --oknodo --retry 30\
    --pidfile $PIDFILE --exec $DAEMON; then
    rm -f $PIDFILE
    log_end_msg 0
    else
    log_end_msg 1
fi
;;
reload)
log_daemon_msg "Reloading $DESC configuration" $NAME
if start-stop-daemon --stop --signal 2 --oknodo --retry 30\
    --quiet --pidfile $PIDFILE --exec $DAEMON; then
    if start-stop-daemon --start --quiet  \
        --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS ; then
        log_end_msg 0
        else
        log_end_msg 1
    fi
    else
    log_end_msg 1
fi
;;
restart|force-reload)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
exit 1
;;
esac

exit 0

Version data entries

16 entries across 16 versions & 9 rubygems

Version Path
Agiley-ec2onrails-0.9.10 server/files/etc/init.d/nginx
ScholarNexus-ec2onrails-0.9.10 server/files/etc/init.d/nginx
ScholarNexus-ec2onrails-0.9.11 server/files/etc/init.d/nginx
arpitjain11-ec2onrails-0.9.10 server/files/etc/init.d/nginx
ewoutvonk-ec2onrails-0.9.10.4.001 server/files/etc/init.d/nginx
gigpark-ec2onrails-0.9.10.3 server/files/etc/init.d/nginx
mdh-ec2onrails-0.9.10 server/files/etc/init.d/nginx
pauldowman-ec2onrails-0.9.10.0 server/files/etc/init.d/nginx
pauldowman-ec2onrails-0.9.10.1 server/files/etc/init.d/nginx
pauldowman-ec2onrails-0.9.10.2 server/files/etc/init.d/nginx
pauldowman-ec2onrails-0.9.10.3 server/files/etc/init.d/nginx
pauldowman-ec2onrails-0.9.10.4 server/files/etc/init.d/nginx
pauldowman-ec2onrails-0.9.10 server/files/etc/init.d/nginx
rsanheim-ec2onrails-0.9.11.1 server/files/etc/init.d/nginx
skippy-ec2onrails-0.9.10 server/files/etc/init.d/nginx
skippy-ec2onrails-0.9.11 server/files/etc/init.d/nginx