# named not starting with "-u named" option

## pitboss

I'm running gentoo (obviously) and am having problems with bind and named.

I can get named to run and function properly without the "-u named" option which makes named run as the named user rather than root.  However, the default init script (on both gentoo and redhat) use the "-u named" switch for security reasons (I assume).

When I try to run named with the -u option, it never starts and doesn't put anything in the logs either.  I've checked to make sure that the named user exists and is in /etc/password.  I've also checked permissions on /etc/bind/ and /var/bind and the files within, to make sure that the named user can access them.

Any ideas on what may be wrong?  I'd really like to use the -u option rather than having it run as root.

The bind version is 9.2.0.

-pitboss

----------

## Nitro

I know this sounds bogus, but I had a problem with bind 9.2.0 and zone-transfers when I would run the command without a trailing space at the end of the command line.  This was on my friend's Mandrake box.  It is prolly one of the most annoying problems, because you look at the command line and it looks fine, took me about a hour to stumble upon it.  :Sad:   It too was running with the -u argument.

If this does work for you, please let me know, sounds like a bug, or maybe it is Mandrake specific.

----------

## pitboss

I tried adding the space at the end of the command line with no luck.

So, to recap:

When I run:

```
root # named
```

everything works fine.  But when I run:

```
root # named -u named
```

it doesn't do anything.  It just exits.

Weird.

-pitboss

----------

## lude

 *pitboss wrote:*   

> 
> 
> ```
> root # named -u named
> ```
> ...

 

Try named -d 5 -u named

Turns on some verbose logging, maybe it'll give you a better hint as to what's going on.

----------

## pitboss

Thanks for the -d option!  I had to add the -g option to see it from the command line.  It turns out that it was having trouble writing the pid file to /var/run/named.pid due to permissions.  I made the /var/run/ directory world writable and everything works now.

So now my question has changed.  I don't want my /var/run/ directory world writable.  In RH Linux, a named directory is created under /var/run/ with named permissions.  So named writes its PID file to /var/run/named/named.pid (and thus, only /var/run/named needs to have write permissions for the named user).  However, I don't know where the PID file location is set for named (however, I do know about the location set in /etc/init.d/named to stop the process).  Any help with this would be appreciated.

-pitboss

----------

