aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcrees <crees@FreeBSD.org>2013-05-31 19:54:01 +0800
committercrees <crees@FreeBSD.org>2013-05-31 19:54:01 +0800
commitae58b89b497a0301c6a58479de4b5ddb16deb9e8 (patch)
tree0b5233ed2a1bc25f12dc9d56da8b18ad62e8ca06
parent13191723730822c675392ffc431470eb8ac4e095 (diff)
downloadfreebsd-ports-gnome-ae58b89b497a0301c6a58479de4b5ddb16deb9e8.tar.gz
freebsd-ports-gnome-ae58b89b497a0301c6a58479de4b5ddb16deb9e8.tar.zst
freebsd-ports-gnome-ae58b89b497a0301c6a58479de4b5ddb16deb9e8.zip
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
-rw-r--r--audio/musicpd/files/musicpd.in3
-rw-r--r--net-mgmt/hawk/files/hawk.in8
-rw-r--r--net-mgmt/nrpe2/files/nrpe2.in3
-rw-r--r--sysutils/munin-node/files/munin-node.in12
-rw-r--r--sysutils/munin-node/files/munin-sched.in12
-rw-r--r--x11/slim/files/slim.in18
6 files changed, 21 insertions, 35 deletions
diff --git a/audio/musicpd/files/musicpd.in b/audio/musicpd/files/musicpd.in
index cf17c20f185d..f367cde80173 100644
--- a/audio/musicpd/files/musicpd.in
+++ b/audio/musicpd/files/musicpd.in
@@ -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"
diff --git a/net-mgmt/hawk/files/hawk.in b/net-mgmt/hawk/files/hawk.in
index 136205702bc8..19fcada9d00c 100644
--- a/net-mgmt/hawk/files/hawk.in
+++ b/net-mgmt/hawk/files/hawk.in
@@ -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"
diff --git a/net-mgmt/nrpe2/files/nrpe2.in b/net-mgmt/nrpe2/files/nrpe2.in
index 05d3cfc614bf..65f3f0bd37a7 100644
--- a/net-mgmt/nrpe2/files/nrpe2.in
+++ b/net-mgmt/nrpe2/files/nrpe2.in
@@ -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'
diff --git a/sysutils/munin-node/files/munin-node.in b/sysutils/munin-node/files/munin-node.in
index e59f4dd135cd..9784e3176fb2 100644
--- a/sysutils/munin-node/files/munin-node.in
+++ b/sysutils/munin-node/files/munin-node.in
@@ -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
diff --git a/sysutils/munin-node/files/munin-sched.in b/sysutils/munin-node/files/munin-sched.in
index c88ad6ab3d0f..45e76b661043 100644
--- a/sysutils/munin-node/files/munin-sched.in
+++ b/sysutils/munin-node/files/munin-sched.in
@@ -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"
diff --git a/x11/slim/files/slim.in b/x11/slim/files/slim.in
index 040b3558aa5b..5fba5c27ecc6 100644
--- a/x11/slim/files/slim.in
+++ b/x11/slim/files/slim.in
@@ -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