Sha256: f742c236aeae4a7de020b014529960f0e092c0f77e104a3acc634ff5684e1a16

Contents?: true

Size: 1.54 KB

Versions: 1

Compression:

Stored size: 1.54 KB

Contents

#!/bin/sh
#
# nginx
#
# chkconfig:   - 57 47
# description: nginx
# processname:  nginx
# config:       /etc/sysconfig/nginx
#

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

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit
exec=<%= node[:nginx][:src_binary] %>
prog=$(basename $exec)

# default options, overruled by items in sysconfig
NGINX_GLOBAL=""

[ -e /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx

lockfile=/var/lock/subsys/nginx

start() {
    [ -x $exec ] || exit 5
    echo -n $"Starting $prog: "
    # if not running, start it up here, usually something like "daemon $exec"
    options=""
    if [ "${NGINX_GLOBAL}" != ""  ]; then
        options="-g ${NGINX_GLOBAL}"
    fi
    $exec $options
    retval=$?
    echo
    [ $retval -eq 0 ] && touch $lockfile
	return $retval
}

stop() {
	echo -n $"Stopping $prog: "
	$exec -s stop
	retval=$?
	echo
	[ $retval -eq 0 ] && rm -f $lockfile
	return $retval
}

restart() {
    stop
    start
}

reload() {
	echo -n $"Reloading $prog: "
	$exec -s reload
	retval=$?
	echo
	[ $retval -eq 0 ] && rm -f $lockfile
	return $retval
}

# See how we were called.
case "$1" in 
  start)
        start
        ;;
  stop)
        stop
        ;;
  status)
        status nginx
        ;;
  restart)
        restart
        ;;
  reload|force-reload)
		reload
		;;
  condrestart)
        [ -f $lockfile ] && restart || :
        ;;
  *)
        echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
        exit 1 
esac

exit $?

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails-up-0.0.1 templates/chef/cookbooks/nginx/templates/default/nginx.init.erb