Skip to content

Commit

Permalink
add FreeBSD redis cluster start/stop daemon script
Browse files Browse the repository at this point in the history
  • Loading branch information
Salimane Adjao Moustapha committed Aug 12, 2011
1 parent 9831791 commit bdfeecf
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions redis-cluster-freebsd
@@ -0,0 +1,40 @@
#!/bin/sh
#
# PROVIDE: redis-cluster
# REQUIRE: LOGIN
# BEFORE: securelevel
# KEYWORD: shutdown

# Add the following line to /etc/rc.conf to enable `redis':
#
#redis_enable="YES"
#

. /etc/rc.subr

name="redis"
rcvar=`set_rcvar`

extra_commands="reload"

command="/usr/local/bin/redis-server"
nodeno=8

# read configuration and set defaults
load_rc_config "$name"
: ${redis_enable="NO"}
: ${redis_user="redis"}



i=0
while [ $i != $nodeno ]; do
i=`expr $i + 1`
nodename="redis-node-$i"
config_file="/usr/local/etc/redis/$nodename.conf"
command_args="${config_file}"
required_files="${config_file}"
echo -n "Starting ${nodename}: "
pidfile="/var/run/redis/$nodename.pid"
run_rc_command "$1"
done

0 comments on commit bdfeecf

Please sign in to comment.