Date: Thu, 29 Oct 2015 01:34:54 +0000 (UTC) From: "Sergey A. Osokin" <osa@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r400428 - in head/databases: redis redis-devel redis-devel/files redis/files Message-ID: <201510290134.t9T1Ysk6096533@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: osa Date: Thu Oct 29 01:34:53 2015 New Revision: 400428 URL: https://svnweb.freebsd.org/changeset/ports/400428 Log: Add rc script for sentinel. Bump PORTREVISION. PR: 204025 Added: head/databases/redis-devel/files/sentinel.in (contents, props changed) head/databases/redis/files/sentinel.in (contents, props changed) Modified: head/databases/redis-devel/Makefile head/databases/redis-devel/pkg-plist head/databases/redis/Makefile head/databases/redis/pkg-plist Modified: head/databases/redis-devel/Makefile ============================================================================== --- head/databases/redis-devel/Makefile Thu Oct 29 01:34:21 2015 (r400427) +++ head/databases/redis-devel/Makefile Thu Oct 29 01:34:53 2015 (r400428) @@ -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 Added: head/databases/redis-devel/files/sentinel.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/databases/redis-devel/files/sentinel.in Thu Oct 29 01:34:53 2015 (r400428) @@ -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" Modified: head/databases/redis-devel/pkg-plist ============================================================================== --- head/databases/redis-devel/pkg-plist Thu Oct 29 01:34:21 2015 (r400427) +++ head/databases/redis-devel/pkg-plist Thu Oct 29 01:34:53 2015 (r400428) @@ -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%% Modified: head/databases/redis/Makefile ============================================================================== --- head/databases/redis/Makefile Thu Oct 29 01:34:21 2015 (r400427) +++ head/databases/redis/Makefile Thu Oct 29 01:34:53 2015 (r400428) @@ -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 Added: head/databases/redis/files/sentinel.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/databases/redis/files/sentinel.in Thu Oct 29 01:34:53 2015 (r400428) @@ -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" Modified: head/databases/redis/pkg-plist ============================================================================== --- head/databases/redis/pkg-plist Thu Oct 29 01:34:21 2015 (r400427) +++ head/databases/redis/pkg-plist Thu Oct 29 01:34:53 2015 (r400428) @@ -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%%
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510290134.t9T1Ysk6096533>