From owner-svn-ports-head@freebsd.org Thu Oct 29 01:34:55 2015 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C45E8A20554; Thu, 29 Oct 2015 01:34:55 +0000 (UTC) (envelope-from osa@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82EF81C65; Thu, 29 Oct 2015 01:34:55 +0000 (UTC) (envelope-from osa@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9T1Ys7C096539; Thu, 29 Oct 2015 01:34:54 GMT (envelope-from osa@FreeBSD.org) Received: (from osa@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9T1Ysk6096533; Thu, 29 Oct 2015 01:34:54 GMT (envelope-from osa@FreeBSD.org) Message-Id: <201510290134.t9T1Ysk6096533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: osa set sender to osa@FreeBSD.org using -f From: "Sergey A. Osokin" Date: Thu, 29 Oct 2015 01:34:54 +0000 (UTC) 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 X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Oct 2015 01:34:55 -0000 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%%