diff options
| author | Sergey A. Osokin <osa@FreeBSD.org> | 2021-08-18 18:01:46 -0400 |
|---|---|---|
| committer | Sergey A. Osokin <osa@FreeBSD.org> | 2021-08-18 18:01:46 -0400 |
| commit | 7ad2136d0760315c890e0126041e43ae24f13900 (patch) | |
| tree | a39a738e513250c0fa67ea48342fe080e398bf1b /databases/redis6/files/sentinel.in | |
| parent | multimedia/libva-intel-driver: enable HYBRID by default (again) (diff) | |
databases/redis6: create a copy before update databases/redis to 6.2
Diffstat (limited to 'databases/redis6/files/sentinel.in')
| -rw-r--r-- | databases/redis6/files/sentinel.in | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/databases/redis6/files/sentinel.in b/databases/redis6/files/sentinel.in new file mode 100644 index 000000000000..088f4382fc06 --- /dev/null +++ b/databases/redis6/files/sentinel.in @@ -0,0 +1,39 @@ +#!/bin/sh + +# 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" |
