aboutsummaryrefslogtreecommitdiffstats
path: root/databases/redis-devel
diff options
context:
space:
mode:
authorosa <osa@FreeBSD.org>2015-10-29 09:34:53 +0800
committerosa <osa@FreeBSD.org>2015-10-29 09:34:53 +0800
commit76059e1f910c6553a2efb1e97712ddf9518ccc68 (patch)
treeff2cd350cbfdb61771292ca042138a5bc3041838 /databases/redis-devel
parent050401d47c4a90be00cb84a30bab3caf7cbf24ab (diff)
downloadfreebsd-ports-gnome-76059e1f910c6553a2efb1e97712ddf9518ccc68.tar.gz
freebsd-ports-gnome-76059e1f910c6553a2efb1e97712ddf9518ccc68.tar.zst
freebsd-ports-gnome-76059e1f910c6553a2efb1e97712ddf9518ccc68.zip
Add rc script for sentinel.
Bump PORTREVISION. PR: 204025
Diffstat (limited to 'databases/redis-devel')
-rw-r--r--databases/redis-devel/Makefile3
-rw-r--r--databases/redis-devel/files/sentinel.in42
-rw-r--r--databases/redis-devel/pkg-plist2
3 files changed, 45 insertions, 2 deletions
diff --git a/databases/redis-devel/Makefile b/databases/redis-devel/Makefile
index f0f046abe991..bb67b4835246 100644
--- a/databases/redis-devel/Makefile
+++ b/databases/redis-devel/Makefile
@@ -3,6 +3,7 @@
PORTNAME= redis
DISTVERSION= 3.0.5
+PORTREVISION= 1
CATEGORIES= databases
MASTER_SITES= http://download.redis.io/releases/
PKGNAMESUFFIX= -devel
@@ -57,7 +58,7 @@ CONFLICTS?= redis-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-devel/files/sentinel.in b/databases/redis-devel/files/sentinel.in
new file mode 100644
index 000000000000..b66ae1492b01
--- /dev/null
+++ b/databases/redis-devel/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-devel/pkg-plist b/databases/redis-devel/pkg-plist
index adbb8f3a38b7..38dadc750ab7 100644
--- a/databases/redis-devel/pkg-plist
+++ b/databases/redis-devel/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%%