NetBSD Problem Report #36192

From smb@cs.columbia.edu  Sun Apr 22 14:17:29 2007
Return-Path: <smb@cs.columbia.edu>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id A7F8E63B960
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 22 Apr 2007 14:17:29 +0000 (UTC)
Message-Id: <20070422131427.D8CE7BC5B7@bigboy.machshav.com>
Date: Sun, 22 Apr 2007 09:14:27 -0400 (EDT)
From: smb@cs.columbia.edu
Reply-To: smb@cs.columbia.edu
To: gnats-bugs@NetBSD.org
Subject: sysutils/apcupsd has a bad rc.d file
X-Send-Pr-Version: 3.95

>Number:         36192
>Category:       pkg
>Synopsis:       sysutils/apcupsd has a bad rc.d file
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bouyer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 22 14:20:01 +0000 2007
>Last-Modified:  Thu Apr 26 13:44:29 +0000 2007
>Originator:     Steven M. Bellovin
>Release:        NetBSD 4.99.17
>Organization:
>Environment:


System: NetBSD bigboy.machshav.com 4.99.17 NetBSD 4.99.17 (BIGBOY) #0: Sun Apr 22 00:44:13 EDT 2007 smb@bigboy.machshav.com:/usr/BUILD/obj/sys/arch/i386/compile/BIGBOY i386
Architecture: i386
Machine: i386
>Description:
	The sample rc.d file isn't right for the NetBSD rc.d system.
>How-To-Repeat:
	See above
>Fix:
	Here's the script I'm using, though I suspect that some
	metavariables need to be used instead, and perhaps a
	variable config file.

	#!/bin/sh
	#

	# PROVIDE: apcupsd
	# REQUIRE: mail

	$_rc_subr_loaded . /etc/rc.subr

	name="apcupsd"
	rcvar=$name
	command="/usr/pkg/sbin/${name}"
	pidfile="/var/run/${name}.pid"
	required_files="/usr/pkg/etc/apcupsd/${name}.conf"
	command_args="--kill-on-powerfail"
	status_cmd="apcupsd_status"

	extra_commands="status"

	apcupsd_status()
	{
		/usr/pkg/sbin/apcaccess status
	}

	load_rc_config $name
	run_rc_command "$1"

>Release-Note:

>Audit-Trail:
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@NetBSD.org, gnats-admin@NetBSD.org,
	pkgsrc-bugs@NetBSD.org
Subject: Re: pkg/36192: sysutils/apcupsd has a bad rc.d file
Date: Sun, 22 Apr 2007 17:57:21 +0200

 On Sun, Apr 22, 2007 at 02:20:01PM +0000, smb@cs.columbia.edu wrote:
 > 	The sample rc.d file isn't right for the NetBSD rc.d system.

 What do you mean here ? the provided script works fine for me.

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: Bernd Ernesti <veego@NetBSD.org>
To: gnats-bugs@NetBSD.org, bouyer@NetBSD.org
Cc: 
Subject: Re: pkg/36192: sysutils/apcupsd has a bad rc.d file
Date: Sun, 22 Apr 2007 17:59:34 +0200

 On Sun, Apr 22, 2007 at 02:20:01PM +0000, smb@cs.columbia.edu wrote:
 > >Description:
 > 	The sample rc.d file isn't right for the NetBSD rc.d system.
 > >How-To-Repeat:
 > 	See above
 > >Fix:
 > 	Here's the script I'm using, though I suspect that some
 > 	metavariables need to be used instead, and perhaps a
 > 	variable config file.

 It is mostly ok, there are only some additional lines missing.

 See the following patch. There is also the issue that the installed
 apcupsd.master.conf is outdated. I mentioned both problems two months ago
 in a reply to pkg/35594.

 Bernd

 --- platforms/netbsd/apcupsd.in.orig	2002-05-28 15:34:05.000000000 +0200
 +++ platforms/netbsd/apcupsd.in	2007-01-05 20:52:42.000000000 +0100
 @@ -6,6 +6,10 @@
  # chkconfig: 2345 20 99
  # description: apcupsd monitors power and takes action if necessary
  #
 +# PROVIDE: apcupsd
 +# REQUIRE: DAEMON
 +# KEYWORD: shutdown
 +#
  APCPID=@PIDDIR@/apcupsd.pid
  APCLOCK=@PIDDIR@/apcupsd.lock
  DISTVER="@DISTVER@"

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Bernd Ernesti <veego@NetBSD.org>
Cc: gnats-bugs@NetBSD.org
Subject: Re: pkg/36192: sysutils/apcupsd has a bad rc.d file
Date: Sun, 22 Apr 2007 18:08:29 +0200

 On Sun, Apr 22, 2007 at 05:59:34PM +0200, Bernd Ernesti wrote:
 > On Sun, Apr 22, 2007 at 02:20:01PM +0000, smb@cs.columbia.edu wrote:
 > > >Description:
 > > 	The sample rc.d file isn't right for the NetBSD rc.d system.
 > > >How-To-Repeat:
 > > 	See above
 > > >Fix:
 > > 	Here's the script I'm using, though I suspect that some
 > > 	metavariables need to be used instead, and perhaps a
 > > 	variable config file.
 > 
 > It is mostly ok, there are only some additional lines missing.
 > 
 > See the following patch. There is also the issue that the installed
 > apcupsd.master.conf is outdated. I mentioned both problems two months ago
 > in a reply to pkg/35594.
 > 
 > Bernd
 > 
 > --- platforms/netbsd/apcupsd.in.orig	2002-05-28 15:34:05.000000000 +0200
 > +++ platforms/netbsd/apcupsd.in	2007-01-05 20:52:42.000000000 +0100
 > @@ -6,6 +6,10 @@
 >  # chkconfig: 2345 20 99
 >  # description: apcupsd monitors power and takes action if necessary
 >  #
 > +# PROVIDE: apcupsd
 > +# REQUIRE: DAEMON
 > +# KEYWORD: shutdown
 > +#
 >  APCPID=@PIDDIR@/apcupsd.pid
 >  APCLOCK=@PIDDIR@/apcupsd.lock
 >  DISTVER="@DISTVER@"

 I don't think you want shutdown here. If apcupsd gets killed while running
 shutdown, won't it kill shutdown itself ?

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: "Steven M. Bellovin" <smb@cs.columbia.edu>
To: gnats-bugs@NetBSD.org
Cc: bouyer@antioche.eu.org, pkg-manager@NetBSD.org,
	gnats-admin@NetBSD.org, pkgsrc-bugs@NetBSD.org
Subject: Re: pkg/36192: sysutils/apcupsd has a bad rc.d file
Date: Sun, 22 Apr 2007 12:20:46 -0400

 On Sun, 22 Apr 2007 16:00:05 +0000 (UTC)
 Manuel Bouyer <bouyer@antioche.eu.org> wrote:

 > The following reply was made to PR pkg/36192; it has been noted by
 > GNATS.
 > 
 > From: Manuel Bouyer <bouyer@antioche.eu.org>
 > To: gnats-bugs@NetBSD.org
 > Cc: pkg-manager@NetBSD.org, gnats-admin@NetBSD.org,
 > 	pkgsrc-bugs@NetBSD.org
 > Subject: Re: pkg/36192: sysutils/apcupsd has a bad rc.d file
 > Date: Sun, 22 Apr 2007 17:57:21 +0200
 > 
 >  On Sun, Apr 22, 2007 at 02:20:01PM +0000, smb@cs.columbia.edu wrote:
 >  > 	The sample rc.d file isn't right for the NetBSD rc.d
 >  > system.
 >  
 >  What do you mean here ? the provided script works fine for me.
 >  
 It will generally work, but because it doesn't use the rc.d framework
 some things don't work.  You can't control it with an rc.conf variable,
 it doesn't honor forcestart/forcestop, there's no sequencing, etc.



 		--Steve Bellovin, http://www.cs.columbia.edu/~smb

Responsible-Changed-From-To: pkg-manager->bouyer
Responsible-Changed-By: reed@netbsd.org
Responsible-Changed-When: Thu, 26 Apr 2007 13:44:29 +0000
Responsible-Changed-Why:
Assign to maintainer.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.