Sha256: 8e3ea0bdb6ea545b27e48a999779563606b754afd3d9aa32396b9124f9d56561

Contents?: true

Size: 1.76 KB

Versions: 1

Compression:

Stored size: 1.76 KB

Contents

#! /bin/sh
### BEGIN INIT INFO
# Provides:             memcached
# Should-Start:         $local_fs
# Should-Stop:          $local_fs
# Default-Start:        2 3 4 5
# Default-Stop:         0 1 6
# Short-Description:    memcached - Memory caching daemon
# Description:          memcached - Memory caching daemon 
### END INIT INFO


PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/bin/memcached
DAEMONBOOTSTRAP=/etc/memcached/memcached.conf
NAME=memcached
DESC=memcached
PIDFILE=<%= memcached_pid_file %>

test -x $DAEMON || exit 0
test -x $DAEMONBOOTSTRAP || exit 0

#PIDFILE=`sed -n 's/-P \(\/\)/\1/p' $DAEMONBOOTSTRAP`
# Remove comments, then tidy whitespace, then concatenate the lines into one line
ARGS=`sed 's/\#.*//;/^[ \n]*$/d;' $DAEMONBOOTSTRAP | tr '\012' ' '`

set -e

case "$1" in
  start)
	  echo -n "Starting $DESC: "
	  touch <%= memcached_pid_file %> && chown <%= memcached_user %>:<%= memcached_group %> <%= memcached_pid_file %>
	  start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $ARGS
	  echo "$NAME."
	  ;;
  stop)
	  echo -n "Stopping $DESC: "
	  start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON 
	  echo "$NAME."
	  rm -f $PIDFILE
	  ;;
  stop)
	  echo -n "Reloading $DESC"
	  kill -HUP `cat $PIDFILE`
	  echo "$NAME."
	  rm -f $PIDFILE
	  ;;

  restart|force-reload)
	  echo -n "Restarting $DESC: "
	  start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
	  rm -f $PIDFILE
	  touch <%= memcached_pid_file %> && chown <%= memcached_user %>:<%= memcached_group %> <%= memcached_pid_file %>

	  start-stop-daemon --start --quiet --exec $ARGS
	  echo "$NAME."
	  ;;
  *)
	  N=/etc/init.d/$NAME
	  echo "Usage: $N {start|stop|reload|restart|force-reload}" >&2
	  exit 1
	  ;;
esac

exit 0

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
Empact-deprec-1.99.21 lib/deprec/templates/memcached/memcached-init-script