summaryrefslogtreecommitdiff
path: root/sysutils/munin-node
diff options
context:
space:
mode:
authorobache <obache>2006-12-29 06:37:03 +0000
committerobache <obache>2006-12-29 06:37:03 +0000
commitd441e575f1cb32ea701513f939d07efbf3dd7a72 (patch)
treeeb223dadd0bd003b858bb7450237296dae91841e /sysutils/munin-node
parentd5c6a57a054f77078990fc3f54e44b82781e85ee (diff)
downloadpkgsrc-d441e575f1cb32ea701513f939d07efbf3dd7a72.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/munin-node')
-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@