Sha256: 615f6783ef6c577cd65f871985aa36a8b6ff8fc1c67c9f8c745788b4b38b278e
Contents?: true
Size: 1.87 KB
Versions: 2
Compression:
Stored size: 1.87 KB
Contents
#!/bin/sh #Configurations injected by install_server below.... REDIS_PORT="<%= redis_port %>" REDIS_BIND_ADDRESS="<%= redis_bind_address ? redis_bind_address : '127.0.0.1' %>" EXEC=<%= redis_bin_dir %>/bin/redis-server CLIEXEC="<%= redis_bin_dir %>/bin/redis-cli -h $REDIS_BIND_ADDRESS -p $REDIS_PORT <%= redis_password ? '-a ' + redis_password : '' %>" PIDFILE="/var/run/redis_${REDIS_PORT}.pid" CONF="/etc/redis/${REDIS_PORT}.conf" ############### # description: redis_<%= redis_port %> is the redis daemon. ### BEGIN INIT INFO # Provides: redis_<%= redis_port %> # Required-Start: # Required-Stop: # Should-Start: # Should-Stop: # Short-Description: start and stop redis_<%= redis_port %> # Description: Redis daemon ### END INIT INFO set -e start() { if [ -x $PIDFILE ] then echo "$PIDFILE exists, process is already running or crashed" else echo "Starting Redis server..." $EXEC $CONF fi } stop() { if [ ! -f $PIDFILE ] then echo "$PIDFILE does not exist, process is not running" else PID=$(cat $PIDFILE) echo "Stopping ..." $CLIEXEC shutdown || /bin/true while [ -x /proc/${PID} ] do echo "Waiting for Redis to shutdown ..." sleep 1 done echo "Redis stopped" fi } restart() { stop echo "Sleeping for 3 seconds..." sleep 3 start } status() { if [ ! -f $PIDFILE ] then echo "$PIDFILE does not exist, redis is not running" exit 3 elif [ ! -x /proc/$(cat $PIDFILE) ] then echo "$PIDFILE exists, process is not running though" exit 1 else echo "redis is running with PID $(cat $PIDFILE)" exit 0 fi } case "$1" in start) start ;; stop) stop ;; restart) restart ;; status) status ;; *) echo "Usage: $SCRIPTNAME {start|stop|restart|status}" ;; esac
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
vagrant-boxen-0.0.4 | puppet-modules/redis/templates/redis.init.erb |
vagrant-boxen-0.0.3 | puppet-modules/redis/templates/redis.init.erb |