Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 May 2013 11:54:01 +0000 (UTC)
From:      Chris Rees <crees@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r319487 - in head: audio/musicpd/files net-mgmt/hawk/files net-mgmt/nrpe2/files sysutils/munin-node/files x11/slim/files
Message-ID:  <201305311154.r4VBs192068226@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: crees
Date: Fri May 31 11:54:01 2013
New Revision: 319487
URL: http://svnweb.freebsd.org/changeset/ports/319487

Log:
  Stop checking for get_pidfile_from_conf function in rc.subr.
  
  It is present in all supported versions of FreeBSD, and has had poor takeup.
  I strongly suspect the strange-looking checks are partially to blame for
  scaring maintainers off.
  
  Go forth and please use it!
  
  PR:		ports/178269
  Approved by:	maintainers of all ports involved

Modified:
  head/audio/musicpd/files/musicpd.in
  head/net-mgmt/hawk/files/hawk.in
  head/net-mgmt/nrpe2/files/nrpe2.in
  head/sysutils/munin-node/files/munin-node.in
  head/sysutils/munin-node/files/munin-sched.in
  head/x11/slim/files/slim.in

Modified: head/audio/musicpd/files/musicpd.in
==============================================================================
--- head/audio/musicpd/files/musicpd.in	Fri May 31 11:33:41 2013	(r319486)
+++ head/audio/musicpd/files/musicpd.in	Fri May 31 11:54:01 2013	(r319487)
@@ -27,8 +27,7 @@ stop_precmd=${name}_getpidfile
 
 musicpd_getpidfile()
 {
-	if type get_pidfile_from_conf >/dev/null 2>&1 &&
-	    get_pidfile_from_conf pid_file %%PREFIX%%/etc/musicpd.conf ; then
+	if get_pidfile_from_conf pid_file %%PREFIX%%/etc/musicpd.conf ; then
 		pidfile="$_pidfile_from_conf"
 	else
 		pidfile="%%MPDDIR%%/.mpd/pid"

Modified: head/net-mgmt/hawk/files/hawk.in
==============================================================================
--- head/net-mgmt/hawk/files/hawk.in	Fri May 31 11:33:41 2013	(r319486)
+++ head/net-mgmt/hawk/files/hawk.in	Fri May 31 11:54:01 2013	(r319487)
@@ -24,18 +24,16 @@ load_rc_config hawk
 command=%%PREFIX%%/sbin/hawk
 command_interpreter=%%PERL%%
 command_args='&'
+start_precmd=find_pidfile
+stop_precmd=find_pidfile
 
 find_pidfile()
 {
-	if type get_pidfile_from_conf >/dev/null 2>&1 &&
-	    get_pidfile_from_conf pidfile %%PREFIX%%/etc/hawk/daemon.conf; then
+	if get_pidfile_from_conf pidfile %%PREFIX%%/etc/hawk/daemon.conf; then
 		pidfile="$_pidfile_from_conf"
 	else
 		pidfile='/var/run/hawk.pid'
 	fi
 }
 
-start_precmd=find_pidfile
-stop_precmd=find_pidfile
-
 run_rc_command "$1"

Modified: head/net-mgmt/nrpe2/files/nrpe2.in
==============================================================================
--- head/net-mgmt/nrpe2/files/nrpe2.in	Fri May 31 11:33:41 2013	(r319486)
+++ head/net-mgmt/nrpe2/files/nrpe2.in	Fri May 31 11:54:01 2013	(r319487)
@@ -37,8 +37,7 @@ find_pidfile()
 	[ -n "$nrpe2_pidfile" ] &&
 	    warn "No longer necessary to set nrpe2_pidfile in rc.conf[.local]"
 
-	if type get_pidfile_from_conf >/dev/null 2>&1 &&
-	    get_pidfile_from_conf pid_file %%PREFIX%%/etc/nrpe.cfg; then
+	if get_pidfile_from_conf pid_file %%PREFIX%%/etc/nrpe.cfg; then
 		pidfile="$_pidfile_from_conf"
 	else
 		pidfile='/var/run/nrpe2/nrpe2.pid'

Modified: head/sysutils/munin-node/files/munin-node.in
==============================================================================
--- head/sysutils/munin-node/files/munin-node.in	Fri May 31 11:33:41 2013	(r319486)
+++ head/sysutils/munin-node/files/munin-node.in	Fri May 31 11:54:01 2013	(r319487)
@@ -15,7 +15,7 @@
 
 . /etc/rc.subr
 
-name="munin_node"
+name=munin_node
 rcvar=munin_node_enable
 
 load_rc_config $name
@@ -31,12 +31,8 @@ stop_precmd=find_pidfile
 
 find_pidfile()
 {
-	if type get_pidfile_from_conf >/dev/null 2>&1 &&
-		get_pidfile_from_conf pid_file $munin_node_config; then
-	    pidfile="$_pidfile_from_conf"
-	else
-	    pidfile=`awk '$1 == "pid_file" { print $2 }' $munin_node_config`
-	fi
+	get_pidfile_from_conf pid_file $munin_node_config
+	pidfile="$_pidfile_from_conf"
 }
 
-run_rc_command "$1"
+run_rc_command $1

Modified: head/sysutils/munin-node/files/munin-sched.in
==============================================================================
--- head/sysutils/munin-node/files/munin-sched.in	Fri May 31 11:33:41 2013	(r319486)
+++ head/sysutils/munin-node/files/munin-sched.in	Fri May 31 11:54:01 2013	(r319487)
@@ -15,7 +15,7 @@
 
 . /etc/rc.subr
 
-name="munin_sched"
+name=munin_sched
 rcvar=munin_sched_enable
 
 load_rc_config $name
@@ -30,13 +30,9 @@ stop_precmd=find_pidfile
 
 find_pidfile()
 {
-	if type get_pidfile_from_conf >/dev/null 2>&1 &&
-		get_pidfile_from_conf pid_file $munin_sched_config; then
-	    pidfile="${_pidfile_from_conf%node*}sched"
-	    pidfile="${pidfile}${_pidfile_from_conf#*node}"
-	else
-	    pidfile=`awk '$1 == "pid_file" { gsub("node","sched",$2); print $2; }' $munin_sched_config`
-	fi
+	get_pidfile_from_conf pid_file $munin_sched_config
+	pidfile="${_pidfile_from_conf%node*}sched"
+	pidfile="${pidfile}${_pidfile_from_conf#*node}"
 }
 
 run_rc_command "$1"

Modified: head/x11/slim/files/slim.in
==============================================================================
--- head/x11/slim/files/slim.in	Fri May 31 11:33:41 2013	(r319486)
+++ head/x11/slim/files/slim.in	Fri May 31 11:54:01 2013	(r319487)
@@ -19,28 +19,26 @@
 name="slim"
 rcvar=slim_enable
 
-start_precmd=${name}_rmfile
-stop_precmd=${name}_prestop
-stop_postcmd=${name}_rmfile
-
-load_rc_config $name
+load_rc_config slim
 
-: ${slim_enable="NO"}
+: ${slim_enable:="NO"}
 
 command=%%PREFIX%%/bin/slim
 command_args="-d"
+start_precmd=${name}_rmfile
+stop_precmd=${name}_prestop
+stop_postcmd=${name}_rmfile
 
 find_pidfile()
 {
-	if type get_pidfile_from_conf >/dev/null 2>&1 &&
-	    get_pidfile_from_conf lockfile %%PREFIX%%/etc/${name}.conf; then
+	if get_pidfile_from_conf lockfile %%PREFIX%%/etc/${name}.conf; then
 		pidfile="$_pidfile_from_conf"
 	else
 		pidfile="/var/run/${name}.pid"
 	fi
 }
 
-slim_rmfile ()
+slim_rmfile()
 {
 	local file
 
@@ -54,7 +52,7 @@ slim_rmfile ()
 	return 0
 }
 
-slim_prestop ()
+slim_prestop()
 {
 	local xpid
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305311154.r4VBs192068226>