Bug 22038 - Default location of named.pid file assumes named is running as root
Summary: Default location of named.pid file assumes named is running as root
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 4.1-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-10-17 05:20 UTC by david
Modified: 2001-06-19 16:33 UTC (History)
0 users

See Also:


Attachments
file.diff (406 bytes, patch)
2000-10-17 05:20 UTC, david
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description david 2000-10-17 05:20:01 UTC
Default location for named's pid file is /var/run, which is owned by root.  This conflicts with named when it is launched with -u bind.  Named is able to create /var/run/named.pid at startup, but generates an error upon "ndc reload":
named[113]: couldn't create pid file '/var/run/named.pid'

Fix: Move the pid file into a subdirectory that can be chowned to bind:
How-To-Repeat: Set up named to run "-u bind".  Run named.  Run "ndc reload".  tail /var/log/messages
Comment 1 Andy Farkas 2000-10-17 06:42:06 UTC
> Move the pid file into a subdirectory that can be chowned to bind:

I like this idea.

--
 
 :{ andyf@speednet.com.au
  
        Andy Farkas
    System Administrator
   Speednet Communications
 http://www.speednet.com.au/
Comment 2 des 2000-10-17 09:33:15 UTC
david@mu.org writes:
> Move the pid file into a subdirectory that can be chowned to bind:

This does not help if named runs chrooted, which it should.

(I have patches to make it run in a jail, BTW)

DES
-- 
Dag-Erling Smorgrav - des@ofug.org
Comment 3 dwmalone 2000-10-17 09:59:51 UTC
On Mon, Oct 16, 2000 at 09:17:12PM -0700, david@mu.org wrote:

[Your message containted some very long lines, so I wrapped them]

> Default location for named's pid file is /var/run, which is owned
> by root.  This conflicts with named when it is launched with -u
> bind.  Named is able to create /var/run/named.pid at startup, but
> generates an error upon "ndc reload":

According to the docs you can tell named where to put it's pid file
by adding:

	pid-file "/var/run/named/named.pid";

to the "options" section of the config file. Changig the default
location of the PID file is a bad idea as it will break lots of
local scripts people have written. Is this option OK for what you
want?

(Bind docs are in /usr/src/contrib/bind/doc/)

	David.
Comment 4 dd freebsd_committer freebsd_triage 2001-06-19 01:10:42 UTC
State Changed
From-To: open->feedback

As dwmalone asked, is the run-time option okay for what you wanted?
Comment 5 dwmalone freebsd_committer freebsd_triage 2001-06-19 16:30:19 UTC
State Changed
From-To: feedback->closed

Runtime directive is OK for relocating pid file.