NetBSD Problem Report #41252

From apb@cequrux.com  Mon Apr 20 16:16:21 2009
Return-Path: <apb@cequrux.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 56C9163BD8A
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 20 Apr 2009 16:16:21 +0000 (UTC)
Message-Id: <20090420161552.7C96FE930BA@apb-laptoy.apb.alt.za>
Date: Mon, 20 Apr 2009 16:15:52 +0000 (UTC)
From: apb@cequrux.com
To: gnats-bugs@gnats.NetBSD.org
Subject: named pid file has moved
X-Send-Pr-Version: 3.95

>Number:         41252
>Category:       bin
>Synopsis:       named pid file has moved
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 20 16:20:00 +0000 2009
>Closed-Date:    Fri May 03 18:29:55 +0000 2024
>Last-Modified:  Fri May 03 18:29:55 +0000 2024
>Originator:     Alan Barrett
>Release:        NetBSD 5.99.11
>Organization:
Not much
>Environment:
System: NetBSD 5.99.11 i386
>Description:
	named(8) has changed the default location of its pid file,
	from /var/run/named.pid to /var/run/named/named.pid.

	/etc/rc.d/named does not know this.

        Due to chroot usage, the pid file is actually created
        in /var/chroot/named/var/run/named/named.pid,
        whereas the outer /var/run/named is a symlink to
        /var/chroot/named/var/run/named.pid.  This causes "/etc/rc.d/named
	stop" to be unable to stop the named process.

>How-To-Repeat:
	Code inspection
>Fix:
	One or more of the following:

	* Change the built-in default back to /var/run/named.pid.

	* Leave the built-in default as the incompatible new
	  value /var/run/named/named.pid, but provide

		options { pid-file "/var/run/named.pid"; }

	  in the default and sample named.conf files.

	* Adjust /etc/rc.d/named.conf to create the symlink as

	  /var/run/named.pid -> /var/chroot/named/var/run/named/named.pid

        * Document the change in src/doc/CHANGES and in release notes
          for the next version of NetBSD.

>Release-Note:

>Audit-Trail:
From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: re: bin/41252: named pid file has moved
Date: Tue, 21 Apr 2009 02:33:56 +1000


    	* Change the built-in default back to /var/run/named.pid.


 yes please.


 .mrg.

From: christos@zoulas.com (Christos Zoulas)
To: matthew green <mrg@eterna.com.au>, gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: re: bin/41252: named pid file has moved
Date: Mon, 20 Apr 2009 12:59:51 -0400

 On Apr 21,  2:33am, mrg@eterna.com.au (matthew green) wrote:
 -- Subject: re: bin/41252: named pid file has moved

 |    
 |    	* Change the built-in default back to /var/run/named.pid.
 | 
 | 
 | yes please.
 | 
 | 
 | .mrg.

 The reason they changed this is:

 2486.   [func]          The default locations for named.pid and lwresd.pid
                         are now /var/run/named/named.pid and
                         /var/run/lwresd/lwresd.pid respectively.

                         This allows the owner of the containing directory
                         to be set, for "named -u" support, and allows there
                         to be a permanent symbolic link in the path, for
                         "named -t" support.  [RT #18306]

 christos

From: "Greg A. Woods" <woods@planix.com>
To: christos@zoulas.com (Christos Zoulas)
Cc: matthew green <mrg@eterna.com.au>,
	NetBSD GNATS <gnats-bugs@NetBSD.org>
Subject: Re: bin/41252: named pid file has moved
Date: Sat, 25 Apr 2009 21:09:28 -0400

 --pgp-sign-Multipart_Sat_Apr_25_21:09:28_2009-1
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: quoted-printable

 At Mon, 20 Apr 2009 12:59:51 -0400, christos@zoulas.com (Christos Zoulas) w=
 rote:
 Subject: re: bin/41252: named pid file has moved
 >=20
 > On Apr 21,  2:33am, mrg@eterna.com.au (matthew green) wrote:
 > -- Subject: re: bin/41252: named pid file has moved
 >=20
 > |   =20
 > |    	* Change the built-in default back to /var/run/named.pid.
 > |=20
 > |=20
 > | yes please.
 > |=20
 > |=20
 > | .mrg.
 >=20
 > The reason they changed this is:
 >=20
 > 2486.   [func]          The default locations for named.pid and lwresd.pid
 >                         are now /var/run/named/named.pid and
 >                         /var/run/lwresd/lwresd.pid respectively.
 >=20
 >                         This allows the owner of the containing directory
 >                         to be set, for "named -u" support, and allows the=
 re
 >                         to be a permanent symbolic link in the path, for
 >                         "named -t" support.  [RT #18306]

 Note that on NetBSD the PID files should _never_ be writable by anyone
 other than root.  The /etc/rc.d infrastructure trusts their content.

 Named should be fixed (once again) to create its PID file before
 changing its runtime user-ID and/or doing chroot.

 --=20
 						Greg A. Woods
 						Planix, Inc.

 <woods@planix.com>       +1 416 218-0099        http://www.planix.com/

 --pgp-sign-Multipart_Sat_Apr_25_21:09:28_2009-1
 Content-Type: application/pgp-signature
 Content-Transfer-Encoding: 7bit

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.7 (NetBSD)

 iD8DBQBJ87RIZn1xt3i/9H8RAn9JAJ9auobOvme/SqPOjiI1G3CYETjXuQCfdeIg
 CBiM7cu04arI7cCC+B6YmsA=
 =39t/
 -----END PGP SIGNATURE-----

 --pgp-sign-Multipart_Sat_Apr_25_21:09:28_2009-1--

State-Changed-From-To: open->closed
State-Changed-By: reed@NetBSD.org
State-Changed-When: Fri, 03 May 2024 18:29:55 +0000
State-Changed-Why:
It has been over a decade since this ticket was opened.
Two days after this ticket, the etc/rc.d/named was changed:
revision 1.19
date: 2009-04-22 18:27:03 +0000;  author: christos;  state: Exp;  lines: +2 -2;
Adjust for new default location of the pid file.

While this didn't reflect all the discussion in this ticket,
also since then named was changed to use root for the pid file even
when running as non-root.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.