# RC reports named crashed but it works [Solved]

## fincoop

Hello all,

I am having some unusual start/stop behaviour with named, and have for several versions. Currently, 'rc-status' reports named has crashed, but I am able to query the service. When I issue 'rc-service named stop' the command succeeds but named is still running, such that if I start it again, the start will fail and the logs indicate that the server already has socket 53 bound. It seems to be more annoyance than anything at this point, but I'm curious if someone has an idea of where I can investigate to find the root of the problem?

Currently running bind 9.11.1_p3 chrooted

Thanks!Last edited by fincoop on Tue Jan 02, 2018 9:28 pm; edited 1 time in total

----------

## Ant P.

Do you have a valid-looking pidfile in /run/named/, or one inside of the chroot? Should be the latter.

----------

## fincoop

 *Ant P. wrote:*   

> Do you have a valid-looking pidfile in /run/named/, or one inside of the chroot? Should be the latter.

 

Thanks for your reply! It looks like I do...

```
(root)-(/chroot/dns/var/run/named)-(15:00)

>>> ls -l

total 8

-rw-r--r-- 1 named named   6 Jan  2 12:47 named.pid

-rw------- 1 named named 102 Jan  2 12:47 session.key

(root)-(/chroot/dns/var/run/named)-(15:00)

>>> more named.pid 

29414

(root)-(/chroot/dns/var/run/named)-(15:01)

>>> ps ax | grep named

29414 ?        Ssl    0:02 /usr/sbin/named -u named -t /chroot/dns

```

----------

## Ant P.

A few other guesses: do you have $PIDFILE set in /etc/conf.d/named, and/or do you have a pid-file defined in named.conf? I'm looking at _get_pidfile() in the initscript and it seems like it can get confused if both are set at the same time.

----------

## fincoop

 *Ant P. wrote:*   

> A few other guesses: do you have $PIDFILE set in /etc/conf.d/named, and/or do you have a pid-file defined in named.conf? I'm looking at _get_pidfile() in the initscript and it seems like it can get confused if both are set at the same time.

 

Thanks again, I only have PID in conf.d

```
(root)-(/etc/conf.d)-(16:18)

>>> grep -i pid named

# Default pid file location

PIDFILE="${CHROOT}/run/named/named.pid"

```

What is interesting though, the config file says /chroot/dns/run/named/ but the file's actual location is /chroot/dns/var/run/named... so that would explain the confusion for sure. Not sure why named is creating the file under /var...Last edited by fincoop on Tue Jan 02, 2018 9:27 pm; edited 1 time in total

----------

## Ant P.

var/run ought to be a symlink to run, is it?

----------

## fincoop

[quote="fincoop"] *Ant P. wrote:*   

> 
> 
> What is interesting though, the config file says /chroot/dns/run/named/ but the file's actual location is /chroot/dns/var/run/named... so that would explain the confusion for sure. Not sure why named is creating the file under /var...

 

I created a symlink from /chroot/dns/var/run to /chroot/dns/run, probably a hack but it fixed the problem.

----------

