summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorobache <obache@pkgsrc.org>2006-12-29 06:37:03 +0000
committerobache <obache@pkgsrc.org>2006-12-29 06:37:03 +0000
commitc6ecbb533b0f070865133257a0ddc66beca61f3a (patch)
treeeb223dadd0bd003b858bb7450237296dae91841e /sysutils
parent73fb2fc77424338a475144c213f585e3c56f94c2 (diff)
downloadpkgsrc-c6ecbb533b0f070865133257a0ddc66beca61f3a.tar.gz
Net::Server breaks rc.subr's techniques for detecting whether the
process running at a certain PID is actually the process we wish to stop. Just unconditionally send SIGTERM to the PID instead, like a security/amavisd-new doing, fixed PR 35334.
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/munin-node/files/munin-node.sh25
1 files changed, 23 insertions, 2 deletions
diff --git a/sysutils/munin-node/files/munin-node.sh b/sysutils/munin-node/files/munin-node.sh
index fb1502ee7d1..8c5984895a8 100644
--- a/sysutils/munin-node/files/munin-node.sh
+++ b/sysutils/munin-node/files/munin-node.sh
@@ -1,6 +1,6 @@
-#! /bin/sh
+#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: munin-node.sh,v 1.3 2006/07/21 23:28:37 abs Exp $
+# $NetBSD: munin-node.sh,v 1.4 2006/12/29 06:37:03 obache Exp $
#
# PROVIDE: munin-node
# REQUIRE: DAEMON
@@ -20,8 +20,29 @@ name="munin_node"
rcvar=$name
command=@PREFIX@/sbin/munin-node
command_interpreter=@PERL@
+pidfile="@VARBASE@/run/munin/munin-node.pid"
required_files=@PKG_SYSCONFDIR@/munin-node.conf
+stop_cmd="munin_node_stop"
+
+# Net::Server breaks rc.subr's techniques for detecting whether the
+# process running at a certain PID is actually the process we wish to
+# stop. Just unconditionally send SIGTERM to the PID instead.
+#
+munin_node_stop()
+{
+ @ECHO@ "Stopping ${name}."
+ if [ -f ${pidfile} ]; then
+ pid=`@HEAD@ -1 ${pidfile}`
+ doit="kill ${pid}"
+ if ! eval $doit && [ -z "$rc_force" ]; then
+ return 1
+ fi
+ wait_for_pids $pid
+ fi
+ @RM@ -f ${pidfile}
+}
+
if [ ! -d @STATEDIR@ ]; then
mkdir @STATEDIR@
chown @MUNIN_USER@:@MUNIN_GROUP@ @STATEDIR@