svn commit: r466198 - in head/databases/go-carbon: . files
Koichiro Iwao
meta at FreeBSD.org
Mon Apr 2 05:55:17 UTC 2018
Author: meta
Date: Mon Apr 2 05:55:16 2018
New Revision: 466198
URL: https://svnweb.freebsd.org/changeset/ports/466198
Log:
databases/go-carbon: Improve rc.d script
Fixes an error with restart.
PR: 226937
Submitted by: Andreas Andersson <a.andersson.thn at gmail.com>
Approved by: hrs (mentor, implicit)
Modified:
head/databases/go-carbon/Makefile
head/databases/go-carbon/files/go-carbon.in
Modified: head/databases/go-carbon/Makefile
==============================================================================
--- head/databases/go-carbon/Makefile Mon Apr 2 05:46:20 2018 (r466197)
+++ head/databases/go-carbon/Makefile Mon Apr 2 05:55:16 2018 (r466198)
@@ -3,7 +3,7 @@
PORTNAME= go-carbon
DISTVERSIONPREFIX= v
DISTVERSION= 0.12.0
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= databases
MAINTAINER= a.andersson.thn at gmail.com
Modified: head/databases/go-carbon/files/go-carbon.in
==============================================================================
--- head/databases/go-carbon/files/go-carbon.in Mon Apr 2 05:46:20 2018 (r466197)
+++ head/databases/go-carbon/files/go-carbon.in Mon Apr 2 05:55:16 2018 (r466198)
@@ -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"
More information about the svn-ports-all
mailing list