NetBSD Problem Report #45775

From www@NetBSD.org  Wed Jan  4 15:01:22 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 6D23E63DD0D
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  4 Jan 2012 15:01:22 +0000 (UTC)
Message-Id: <20120104150121.BF68B63BC35@www.NetBSD.org>
Date: Wed,  4 Jan 2012 15:01:21 +0000 (UTC)
From: nathanialsloss@yahoo.com.au
Reply-To: nathanialsloss@yahoo.com.au
To: gnats-bugs@NetBSD.org
Subject: LPRng startup script wrong pid file
X-Send-Pr-Version: www-1.0

>Number:         45775
>Category:       pkg
>Synopsis:       LPRng startup script wrong pid file
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 04 15:05:00 +0000 2012
>Last-Modified:  Mon Jan 23 06:55:01 +0000 2012
>Originator:     Nat Sloss
>Release:        NetBSD 5.0.1
>Organization:
>Environment:
NetBSD beast 5.0.1 NetBSD 5.0.1 (BEAST) #92: Mon Jan  2 23:55:27 EST 2012  build@beast:/home/build/NetBSD-5.0.1_source_tree/usr/src/sys/arch/i386/compile/BEAST i386
>Description:
LPRng's rc script uses the wrong pid file 'lpd.pid' where it should be using 'lpd.515'

When running "/etc/rc.d/LPRng status" a message is displayed that LPRng is not running.
>How-To-Repeat:
Enable lprng in rc.conf,

Start lprng.

execute '/etc/rc.d/LPRng status'
>Fix:
I patched LPRng.sh so that it references the correct pid file.

--- files/LPRng.sh.orig 2011-12-10 01:59:28.000000000 +1100
+++ files/LPRng.sh      2011-12-10 01:41:57.000000000 +1100
@@ -10,7 +10,7 @@
 name="LPRng"
 rcvar=$name
 command="@PREFIX@/sbin/lpd"
-pidfile="/var/run/lpd.pid"
+pidfile="/var/run/lpd.515"
 required_files="@PKG_SYSCONFDIR@/lpd/lpd.conf"

 LPRng_prestart()


I tried changing configure options to change it to lpd.pid to no avail.  The only other option is to patch the source, but I think it's easier to modify the start up script.

Regards,

Nat.

>Audit-Trail:
From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/45775: LPRng startup script wrong pid file
Date: Sun, 22 Jan 2012 17:11:01 +0000

 On Wed, Jan 04, 2012 at 03:05:00PM +0000, nathanialsloss@yahoo.com.au wrote:
  > LPRng's rc script uses the wrong pid file 'lpd.pid' where it should
  > be using 'lpd.515'

 515? That doesn't seem right...

 -- 
 David A. Holland
 dholland@netbsd.org

From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/45775: LPRng startup script wrong pid file
Date: Sun, 22 Jan 2012 18:19:28 +0100

 On Sun, Jan 22, 2012 at 05:15:04PM +0000, David Holland wrote:
 > The following reply was made to PR pkg/45775; it has been noted by GNATS.
 > 
 > From: David Holland <dholland-pbugs@netbsd.org>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: pkg/45775: LPRng startup script wrong pid file
 > Date: Sun, 22 Jan 2012 17:11:01 +0000
 > 
 >  On Wed, Jan 04, 2012 at 03:05:00PM +0000, nathanialsloss@yahoo.com.au wrote:
 >   > LPRng's rc script uses the wrong pid file 'lpd.pid' where it should
 >   > be using 'lpd.515'
 >  
 >  515? That doesn't seem right...

 It is using the protocol number.

 Joerg

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/45775: LPRng startup script wrong pid file
Date: Sun, 22 Jan 2012 17:37:51 +0000

 On Sun, Jan 22, 2012 at 05:20:04PM +0000, Joerg Sonnenberger wrote:
  >  >   > LPRng's rc script uses the wrong pid file 'lpd.pid' where it should
  >  >   > be using 'lpd.515'
  >  >  
  >  >  515? That doesn't seem right...
  >  
  >  It is using the protocol number.

 ew.

 Can we at least make it lpd.515.pid or something?

 -- 
 David A. Holland
 dholland@netbsd.org

From: Nat Sloss <nathanialsloss@yahoo.com.au>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/45775
Date: Mon, 23 Jan 2012 17:45:32 +1100

 Hi,

 With the following patches LPRng uses lpd.pid:

 --- src/common/checkpc.c.orig   2004-09-24 20:19:57.000000000 +0000
 +++ src/common/checkpc.c
 @@ -188,7 +188,7 @@ int main( int argc, char *argv[], char *
         } else {
                 int oldfile = Spool_file_perms_DYN;
                 Spool_file_perms_DYN = 0644;
 -               path = safestrdup3( Lockfile_DYN,".", Lpd_port_DYN, __FILE__, 
 __
 LINE__ );
 +               path = safestrdup2( Lockfile_DYN,".pid", __FILE__, __LINE__ );
                 if(Verbose)MESSAGE( "LPD lockfile '%s'", path );
                 if( path[0] != '/' ){
                         WARNMSG( "Warning: LPD lockfile '%s' not absolute 
 path",
  path );
 --- src/common/child.c.orig     2004-09-24 20:19:57.000000000 +0000
 +++ src/common/child.c
 @@ -261,7 +261,7 @@ plp_signal_t cleanup (int passed_signal)
                 Sigstr(passed_signal), Errorcode );
  #if defined(__CYGWIN__)
         if( getpid() == Server_pid ) {
 -               char *path = safestrdup3( Lockfile_DYN,".", Lpd_port_DYN, 
 __FILE
 __, __LINE__ );
 +               char *path = safestrdup2( Lockfile_DYN,".pid", __FILE__, 
 __LINE_
 _ );
          unlink(path);
                 if( path ) free(path); path = 0;
         }

 --- src/common/lpd.c.orig       2004-09-24 20:19:58.000000000 +0000
 +++ src/common/lpd.c
 @@ -772,7 +772,7 @@ int Get_lpd_pid(void)
         char *path;
         struct stat statb;

 -       path = safestrdup3( Lockfile_DYN,".", Lpd_port_DYN, __FILE__, 
 __LINE__ )
 ;
 +       path = safestrdup2( Lockfile_DYN,".pid", __FILE__, __LINE__ );
         pid = -1;
         lockfd = Checkread( path, &statb );
         if( lockfd >= 0 ){
 @@ -800,7 +800,7 @@ int Lock_lpd_pid(void)
         struct stat statb;
         int euid = geteuid();

 -       path = safestrdup3( Lockfile_DYN,".", Lpd_port_DYN, __FILE__, 
 __LINE__ )
 ;
 +       path = safestrdup2( Lockfile_DYN,".pid", __FILE__, __LINE__ );
         To_euid_root();
         lockfd = Checkwrite( path, &statb, O_RDWR, 1, 0 );
         if( lockfd < 0 ){

 I hope this helps.

 Regards,

 Nat.

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.