pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/munin-node/files Net::Server breaks rc.subr's...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f4ff92b492d1
branches:  trunk
changeset: 522891:f4ff92b492d1
user:      obache <obache%pkgsrc.org@localhost>
date:      Fri Dec 29 06:37:03 2006 +0000

description:
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:

 sysutils/munin-node/files/munin-node.sh |  25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diffs (42 lines):

diff -r d158e46a734c -r f4ff92b492d1 sysutils/munin-node/files/munin-node.sh
--- a/sysutils/munin-node/files/munin-node.sh   Fri Dec 29 06:21:52 2006 +0000
+++ b/sysutils/munin-node/files/munin-node.sh   Fri Dec 29 06:37:03 2006 +0000
@@ -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 @@
 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@



Home | Main Index | Thread Index | Old Index