aboutsummaryrefslogtreecommitdiff
path: root/databases/redis
diff options
context:
space:
mode:
authorSergey A. Osokin <osa@FreeBSD.org>2015-10-29 01:34:53 +0000
committerSergey A. Osokin <osa@FreeBSD.org>2015-10-29 01:34:53 +0000
commit6d6485b55600796d513b2f5eb189f533ad80516a (patch)
treeff2cd350cbfdb61771292ca042138a5bc3041838 /databases/redis
parentd659d4761b8b3e79695b268e7896139148312c77 (diff)
downloadports-6d6485b55600796d513b2f5eb189f533ad80516a.tar.gz
ports-6d6485b55600796d513b2f5eb189f533ad80516a.zip
Notes
Diffstat (limited to 'databases/redis')
-rw-r--r--databases/redis/Makefile3
-rw-r--r--databases/redis/files/sentinel.in42
-rw-r--r--databases/redis/pkg-plist2
3 files changed, 45 insertions, 2 deletions
diff --git a/databases/redis/Makefile b/databases/redis/Makefile
index d9b83328b822..b6650d5233c6 100644
--- a/databases/redis/Makefile
+++ b/databases/redis/Makefile
@@ -3,6 +3,7 @@
PORTNAME= redis
DISTVERSION= 3.0.5
+PORTREVISION= 1
CATEGORIES= databases
MASTER_SITES= http://download.redis.io/releases/
@@ -56,7 +57,7 @@ CONFLICTS?= redis-devel-3.*
USES+= gmake
MAKE_ENV= "V=yo"
-USE_RC_SUBR= redis
+USE_RC_SUBR= redis sentinel
BIN_FILES= redis-benchmark redis-check-aof redis-check-dump \
redis-cli redis-sentinel redis-server
diff --git a/databases/redis/files/sentinel.in b/databases/redis/files/sentinel.in
new file mode 100644
index 000000000000..b66ae1492b01
--- /dev/null
+++ b/databases/redis/files/sentinel.in
@@ -0,0 +1,42 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: sentinel
+# REQUIRE: LOGIN
+# BEFORE: securelevel
+# KEYWORD: shutdown
+
+# Add the following line to /etc/rc.conf to enable `sentinel':
+#
+#sentinel_enable="YES"
+#
+
+. /etc/rc.subr
+
+name="sentinel"
+rcvar="${name}_enable"
+
+command="/usr/local/bin/redis-sentinel"
+pidfile="/var/run/redis/$name.pid"
+
+# read configuration and set defaults
+load_rc_config "$name"
+: ${sentinel_enable="NO"}
+: ${sentinel_user="redis"}
+: ${sentinel_config="/usr/local/etc/$name.conf"}
+
+command_args="${sentinel_config} --daemonize yes --pidfile ${pidfile}"
+required_files="${sentinel_config}"
+start_precmd="${name}_checks"
+restart_precmd="${name}_checks"
+
+sentinel_checks()
+{
+ if [ x`id -u ${sentinel_user}` != x`stat -f %u ${sentinel_config}` ]; then
+ err 1 "${sentinel_config} must be owned by user ${sentinel_user}"
+ fi
+}
+
+run_rc_command "$1"
diff --git a/databases/redis/pkg-plist b/databases/redis/pkg-plist
index adbb8f3a38b7..38dadc750ab7 100644
--- a/databases/redis/pkg-plist
+++ b/databases/redis/pkg-plist
@@ -6,7 +6,7 @@ bin/redis-sentinel
bin/redis-server
%%TRIB%%bin/redis-trib.rb
@sample etc/redis.conf.sample
-@sample etc/sentinel.conf.sample
+@sample(%%REDIS_USER%%,%%REDIS_GROUP%%,) etc/sentinel.conf.sample
@dir(%%REDIS_USER%%,%%REDIS_GROUP%%,) %%REDIS_DBDIR%%
@dir(%%REDIS_USER%%,%%REDIS_GROUP%%,) %%REDIS_LOGDIR%%
@dir(%%REDIS_USER%%,%%REDIS_GROUP%%,) %%REDIS_RUNDIR%%