Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add FreeBSD redis cluster start/stop daemon script
- 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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |