From owner-svn-ports-all@freebsd.org Thu Apr 5 19:59:23 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3CFFF9E8F6; Thu, 5 Apr 2018 19:59:22 +0000 (UTC) (envelope-from riggs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82D2B6E4B1; Thu, 5 Apr 2018 19:59:22 +0000 (UTC) (envelope-from riggs@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60E8227348; Thu, 5 Apr 2018 19:59:22 +0000 (UTC) (envelope-from riggs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35JxMt7012116; Thu, 5 Apr 2018 19:59:22 GMT (envelope-from riggs@FreeBSD.org) Received: (from riggs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35JxMB7012113; Thu, 5 Apr 2018 19:59:22 GMT (envelope-from riggs@FreeBSD.org) Message-Id: <201804051959.w35JxMB7012113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: riggs set sender to riggs@FreeBSD.org using -f From: Thomas Zander Date: Thu, 5 Apr 2018 19:59:22 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r466596 - in branches/2018Q2/databases/go-carbon: . files X-SVN-Group: ports-branches X-SVN-Commit-Author: riggs X-SVN-Commit-Paths: in branches/2018Q2/databases/go-carbon: . files X-SVN-Commit-Revision: 466596 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Apr 2018 19:59:23 -0000 Author: riggs Date: Thu Apr 5 19:59:21 2018 New Revision: 466596 URL: https://svnweb.freebsd.org/changeset/ports/466596 Log: MFH: r466198 databases/go-carbon: Improve rc.d script Fixes an error with restart. PR: 226937 Submitted by: Andreas Andersson Approved by: hrs (mentor, implicit) Approved by: ports-secteam (riggs) Reported by: meta (via mail) Modified: branches/2018Q2/databases/go-carbon/Makefile branches/2018Q2/databases/go-carbon/files/go-carbon.in Directory Properties: branches/2018Q2/ (props changed) Modified: branches/2018Q2/databases/go-carbon/Makefile ============================================================================== --- branches/2018Q2/databases/go-carbon/Makefile Thu Apr 5 19:57:06 2018 (r466595) +++ branches/2018Q2/databases/go-carbon/Makefile Thu Apr 5 19:59:21 2018 (r466596) @@ -3,7 +3,7 @@ PORTNAME= go-carbon DISTVERSIONPREFIX= v DISTVERSION= 0.12.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= databases MAINTAINER= a.andersson.thn@gmail.com Modified: branches/2018Q2/databases/go-carbon/files/go-carbon.in ============================================================================== --- branches/2018Q2/databases/go-carbon/files/go-carbon.in Thu Apr 5 19:57:06 2018 (r466595) +++ branches/2018Q2/databases/go-carbon/files/go-carbon.in Thu Apr 5 19:59:21 2018 (r466596) @@ -21,35 +21,36 @@ . /etc/rc.subr -name="go-carbon" +name="go_carbon" rcvar="go_carbon_enable" +load_rc_config $name : ${go_carbon_enable:="NO"} : ${go_carbon_user:="carbon"} : ${go_carbon_config:="/usr/local/etc/go-carbon/go-carbon.conf"} -start_cmd="go_carbon_start" -stop_cmd="go_carbon_stop" -status_cmd="go_carbon_status" -procname="/usr/local/bin/go-carbon" pidfile="/var/run/$name.pid" +procname="%%PREFIX%%/bin/go-carbon" +command=/usr/sbin/daemon +command_args="-f -c -p ${pidfile} ${procname} -config ${go_carbon_config}" -# read configuration and set defaults -load_rc_config "$name" +extra_commands="reload" +reload_command="go_carbon_reload" +start_precmd="go_carbon_precmd" -go_carbon_start() +go_carbon_precmd() { - ${procname} -config ${go_carbon_config} -daemon -pidfile ${pidfile} + install -o ${go_carbon_user} /dev/null ${pidfile} } -go_carbon_stop() +carbonapi_reload() { - kill -TERM `cat /var/run/go-carbon.pid` -} - -go_carbon_status() -{ - echo "go-carbon is running as pid" `cat /var/run/go-carbon.pid` + if [ -n "$pid" ]; then + kill -HUP $pid + echo "go-carbon config reloaded." + else + echo "go-carbon not running." + fi } run_rc_command "$1"