diff options
author | Sergey A. Osokin <osa@FreeBSD.org> | 2019-11-21 19:27:39 +0000 |
---|---|---|
committer | Sergey A. Osokin <osa@FreeBSD.org> | 2019-11-21 19:27:39 +0000 |
commit | 89e0b04783bb6f6a0dde7811bb8af7da69eeac17 (patch) | |
tree | f097f4a4a9b81f0cf39752ffc85ef362a0176797 /databases/redis4/files/sentinel.in | |
parent | cad/openvsp: update to 3.19.1 (diff) |
Repocopy the databases/redis to the databases/redis4 to update
the databases/redis port to the latest stable version, 5.0.6.
PR: 241526
Reviewed by: portmgr (adamw)
Approved by: portmgr (adamw)
Differential Revision: https://reviews.freebsd.org/D22336
Diffstat (limited to 'databases/redis4/files/sentinel.in')
-rw-r--r-- | databases/redis4/files/sentinel.in | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/databases/redis4/files/sentinel.in b/databases/redis4/files/sentinel.in new file mode 100644 index 000000000000..b66ae1492b01 --- /dev/null +++ b/databases/redis4/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" |