NetBSD Problem Report #53290

From ef@math.uni-bonn.de  Tue May 15 15:14:37 2018
Return-Path: <ef@math.uni-bonn.de>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id BF9DE7A166
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 15 May 2018 15:14:37 +0000 (UTC)
Message-Id: <20180515151434.8645A1BE73@trave.math.uni-bonn.de>
Date: Tue, 15 May 2018 17:14:34 +0200 (CEST)
From: ef@math.uni-bonn.de
Reply-To: ef@math.uni-bonn.de
To: gnats-bugs@gnats.NetBSD.org
Subject: snmptrapd's rc file doesn't remove pidfile on stop
X-Send-Pr-Version: 3.95

>Number:         53290
>Category:       pkg
>Synopsis:       snmptrapd's rc file doesn't remove pidfile on stop
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    adam
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 15 15:15:00 +0000 2018
>Last-Modified:  Tue May 15 19:27:47 +0000 2018
>Originator:     Edgar Fuß
>Release:        pkgsrc-2017Q3
>Organization:
Mathematisches Institut der Universität Bonn
>Environment:

>Description:
	On stop, the snmptrapd rc file provided by net/net-snmp
	doesn't delete the PID file, making, i.e. the monitoring
	check_pid plugin barf.
>How-To-Repeat:
	/etc/rc.d/snmptrapd start; /etc/rc.d/snmptrapd stop; ls /var/run/snmptrad.pid
>Fix:
	Index: Makefile
	===================================================================
	RCS file: /cvsroot/pkgsrc/net/net-snmp/Makefile,v
	retrieving revision 1.120
	diff -u -r1.120 Makefile
	--- Makefile	23 Jul 2017 17:43:33 -0000	1.120
	+++ Makefile	15 May 2018 15:05:51 -0000
	@@ -2,7 +2,7 @@

	 .include "Makefile.common"
	 CATEGORIES=	net
	-PKGREVISION=	7
	+PKGREVISION=	8

	 MAINTAINER=	adam@NetBSD.org
	 COMMENT=	Extensible SNMP implementation
	Index: files/snmptrapd.sh
	===================================================================
	RCS file: /cvsroot/pkgsrc/net/net-snmp/files/snmptrapd.sh,v
	retrieving revision 1.5
	diff -u -r1.5 snmptrapd.sh
	--- files/snmptrapd.sh	22 Oct 2011 07:33:34 -0000	1.5
	+++ files/snmptrapd.sh	15 May 2018 15:05:51 -0000
	@@ -16,6 +16,7 @@
	 command="@PREFIX@/sbin/${name}"
	 pidfile="/var/run/${name}.pid"
	 command_args="-p ${pidfile}"
	+stop_postcmd="rm -f ${pidfile}"

	 if [ -f @PKG_SYSCONFDIR@/snmptrapd.conf ]; then
		command_args="${command_args} -c @PKG_SYSCONFDIR@/snmptrapd.conf"

>Release-Note:

>Audit-Trail:
From: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/53290: snmptrapd's rc file doesn't remove pidfile on stop
Date: Tue, 15 May 2018 17:56:56 +0000

 Hi,

 I don't see other scripts are doing this.
 If this is desirable behaviour (decided upon by people who have strong
 opinions on the topic), we can implement this for all of them at once.

From: Edgar =?iso-8859-1?B?RnXf?= <ef@math.uni-bonn.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/53290: snmptrapd's rc file doesn't remove pidfile on stop
Date: Tue, 15 May 2018 20:03:49 +0200

 > I don't see other scripts are doing this.
 Yes. It's normally done by the daemon on shutdown. That's why a PID file without a corresponding running process can be treated as a sign of a daemon having crashed. And that's what check_pid is good for. Or so I think.

Responsible-Changed-From-To: pkg-manager->adam
Responsible-Changed-By: hauke@NetBSD.org
Responsible-Changed-When: Tue, 15 May 2018 19:27:47 +0000
Responsible-Changed-Why:
Over to maintainer.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.