#! /bin/sh ### BEGIN INIT INFO # Provides: repcached # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Should-Start: $local_fs # Should-Stop: $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start repcached daemon # Description: Start up repcached, a high-performance memory caching daemon with replication ### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/local/bin/memcached DAEMONBOOTSTRAP=/usr/share/memcached/scripts/start-repcached NAME=repcached DESC=repcached PIDFILE=/var/run/$NAME.pid test -x $DAEMON || exit 0 test -x $DAEMONBOOTSTRAP || exit 0 set -e . /lib/lsb/init-functions # Edit /etc/default/repcached to change this. ENABLE_REPCACHED=no test -r /etc/default/repcached && . /etc/default/repcached case "$1" in start) echo -n "Starting $DESC: " if [ $ENABLE_REPCACHED = yes ]; then start-stop-daemon --start --quiet --exec $DAEMONBOOTSTRAP echo "$NAME." else echo "$NAME disabled in /etc/default/repcached." fi ;; stop) echo -n "Stopping $DESC: " start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON echo "$NAME." rm -f $PIDFILE ;; restart|force-reload) # # If the "reload" option is implemented, move the "force-reload" # option to the "reload" entry above. If not, "force-reload" is # just the same as "restart". # echo -n "Restarting $DESC: " start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE rm -f $PIDFILE sleep 1 start-stop-daemon --start --quiet --exec $DAEMONBOOTSTRAP echo "$NAME." ;; status) status_of_proc $DAEMON $NAME ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|restart|force-reload|status}" >&2 exit 1 ;; esac exit 0