named stop to work

pppplus

Verified User
Joined
Dec 19, 2008
Messages
524
Hi

I've a strange and new problem.

named is broken from yesterday (I just a reboot the VPS).
After rebooting, no problem, named is ok.

But, some minuts/hours after, I receive a notification.
Code:
service named status
Redirecting to /bin/systemctl status  named.service
* named.service - Berkeley Internet Name Domain (DNS)
   Loaded: loaded (/etc/systemd/system/named.service; enabled; vendor preset: disabled)
   Active: [COLOR="#FF0000"][B]failed[/B][/COLOR] (Result: timeout) since Sun 2017-03-12 11:03:06 CET; 44s ago
  Process: 16978 ExecStart=/usr/sbin/named -u named $OPTIONS (code=exited, status=0/SUCCESS)
  Process: 16975 ExecStartPre=/usr/sbin/named-checkconf -z /etc/named.conf (code=exited, status=0/SUCCESS)

Mar 12 11:01:36 host1v104.hb50.fr named[16979]: zone kidnet.fr/IN: sending notifies (serial 2016022500)
Mar 12 11:01:36 host1v104.hb50.fr named[16979]: zone presta-modules.fr.cr/IN: sending notifies (serial 2017021701)
Mar 12 11:01:36 host1v104.hb50.fr named[16979]: zone echecs.ovh/IN: sending notifies (serial 2016112403)
Mar 12 11:01:36 host1v104.hb50.fr named[16979]: zone zzzovniz.fr/IN: sending notifies (serial 2015120205)
Mar 12 11:01:36 host1v104.hb50.fr named[16979]: zone monptp.fr.cr/IN: sending notifies (serial 2016052401)
Mar 12 11:01:36 host1v104.hb50.fr named[16979]: zone presta-modules.fr.nf/IN: sending notifies (serial 2017021701)
Mar 12 11:03:06 host1v104.hb50.fr systemd[1]: named.service start operation timed out. Terminating.
Mar 12 11:03:06 host1v104.hb50.fr systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
Mar 12 11:03:06 host1v104.hb50.fr systemd[1]: Unit named.service entered failed state.
Mar 12 11:03:06 host1v104.hb50.fr systemd[1]: named.service failed.

When I run :
./build rewrite_confs

named is ok :
Code:
service named status
Redirecting to /bin/systemctl status  named.service
* named.service - Berkeley Internet Name Domain (DNS)
   Loaded: loaded (/etc/systemd/system/named.service; enabled; vendor preset: disabled)
   Active: activating (start) since Sun 2017-03-12 11:04:01 CET; 49s ago
   CGroup: /system.slice/named.service
           `-18038 /usr/sbin/named -u named

Mar 12 11:04:01 host1v104.hb50.fr systemd[1]: PID file /run/named/named.pid not readable (yet?) after start.
Mar 12 11:04:01 host1v104.hb50.fr named[18038]: running
Mar 12 11:04:01 host1v104.hb50.fr named[18038]: zone kidnet.fr/IN: sending notifies (serial 2016022500)
Mar 12 11:04:01 host1v104.hb50.fr named[18038]: zone ovniz.fr/IN: sending notifies (serial 2015120900)
Mar 12 11:04:01 host1v104.hb50.fr named[18038]: zone monptp.fr.cr/IN: sending notifies (serial 2016052401)
Mar 12 11:04:01 host1v104.hb50.fr named[18038]: zone host1v104.hb50.fr/IN: sending notifies (serial 2015111300)
Mar 12 11:04:01 host1v104.hb50.fr named[18038]: zone zzzovniz.fr/IN: sending notifies (serial 2015120205)
Mar 12 11:04:01 host1v104.hb50.fr named[18038]: zone presta-modules.fr.cr/IN: sending notifies (serial 2017021701)
Mar 12 11:04:01 host1v104.hb50.fr named[18038]: zone echecs.ovh/IN: sending notifies (serial 2016112403)
Mar 12 11:04:01 host1v104.hb50.fr named[18038]: zone presta-modules.fr.nf/IN: sending notifies (serial 2017021701)

When I run
service named restart

It's very long, and I've the message
Code:
Redirecting to /bin/systemctl restart  named.service
Job for named.service failed because a timeout was exceeded. See "systemctl status named.service" and "journalctl -xe" for details.
systemctl status named.service show named is actually running


Have you an idea about my problem ?
Where to search to find the problem ?

I'm on Centos 7.3

Thanks
 
Last edited:

pppplus

Verified User
Joined
Dec 19, 2008
Messages
524
Thanks for reply:

The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

And with systemctl, not better :
/bin/systemctl configtest named.service
Unknown operation 'configtest'.
 

pppplus

Verified User
Joined
Dec 19, 2008
Messages
524
in /run/named, there is no file named.pid

So, the problem seems to be the file is never created here.

Is it a permission problem ?
 

Sergey

Verified User
Joined
Oct 29, 2016
Messages
20
or please try this one:
Code:
named-checkconf /etc/named.conf
and if bind is running in chroot environment try this:
Code:
named-checkconf -t /var/named/chroot /etc/named.conf
 

pppplus

Verified User
Joined
Dec 19, 2008
Messages
524
I add -z, otherwhile, I've no answer :

Code:
/named-checkconf -z /etc/named.conf
zone localhost.localdomain/IN: loaded serial 0
zone localhost/IN: loaded serial 0
zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0
zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
zone 0.in-addr.arpa/IN: loaded serial 0
zone host1v104.hb50.fr/IN: loaded serial 2015111300
zone ovniz.fr/IN: loaded serial 2015120900
zone kidnet.fr/IN: loaded serial 2016022500
zone monptp.fr.cr/IN: loaded serial 2016052401
zone presta-modules.fr.nf/IN: loaded serial 2017021701
zone echecs.ovh/IN: loaded serial 2016112403
zone presta-modules.fr.cr/IN: loaded serial 2017021701
 

Sergey

Verified User
Joined
Oct 29, 2016
Messages
20
There is no problem with your configuration.
Maybe other guys could help you.
I found this solution in one forum but i am not sure about it.

I managed to resolve this by changing one line in /etc/named.conf:

named='named'
To -->
named='named -u named'
 

pppplus

Verified User
Joined
Dec 19, 2008
Messages
524
I've no line named='named' in /etc/named.conf.

When I run :
#named -fg
errors are :
Code:
12-Mar-2017 14:06:38.354 open: /etc/rndc.key: permission denied
12-Mar-2017 14:06:38.354 couldn't add command channel 127.0.0.1#953: permission denied
12-Mar-2017 14:06:38.354 open: /etc/rndc.key: permission denied
12-Mar-2017 14:06:38.354 couldn't add command channel ::1#953: permission denied
12-Mar-2017 14:06:38.354 not using config file logging statement for logging due to -g option
isc_file_isplainfile 'data/named.run' failed: permission denied
12-Mar-2017 14:06:38.354 checking logging configuration failed: permission denied
12-Mar-2017 14:06:38.354 loading configuration: permission denied
12-Mar-2017 14:06:38.354 exiting (due to fatal error)
 

pppplus

Verified User
Joined
Dec 19, 2008
Messages
524
Anyone for an idea ?

Permissions was root:root for /run/named

I change permissions to :
drwxr-xr-x 2 named root 80 Mar 14 10:58 named

It works (it works also with named / named)

Can it be a problem for something else in the system ?
Is it better named:root or named:named ?

Thanks
 
Last edited:

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,255
Location
GMT +7.00
Your changes of permissions on /run/named won't survive a reboot, if /run is mounted as tmpfs:

Code:
mount | grep ' /run '
tmpfs on /run type [B]tmpfs[/B] (rw,nosuid,noexec,relatime,size=404080k,nr_inodes=505099,mode=755)

you might need to change directory in named.conf from
/run/named to something different
 

pppplus

Verified User
Joined
Dec 19, 2008
Messages
524
Yes you're right, permission comes back to root:root after restarting the container.
Do you know why I've this problem ?
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
5,480
Location
Maastricht
I found this was a bug a while ago already in Fedora, but exact the same error notice. Maybe they fixed it, but this was the solution, maybe you can try it, add this to your named.conf:
Code:
pid-file      "/var/run/named/named.pid";
 

pppplus

Verified User
Joined
Dec 19, 2008
Messages
524
J'ai déjà cette ligne (plus exactement pid-file "/run/named/named.pid";)
/var/run renvoie vers /run

=> j'avais déjà testé en mettant /var devant également, mais bien sûr sans changement
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,255
Location
GMT +7.00
Google Translate:

I have already this line (more precisely pid-file "/run/named/named.pid"
/var/run returns to /run => I already tested by putting /var in front of it, but of course without change
So it seems /var/run/ is a simlink for /run/.

CentOS 7 has this:

Code:
# ls -la /var/run
lrwxrwxrwx. 1 root root 6 Jul  9  2014 /var/run -> ../run
In this case feel free to change it to /var/named/run/ (you might need to create it first and change ownership).
 
Last edited:

pppplus

Verified User
Joined
Dec 19, 2008
Messages
524
Sorry, I answer previously in french !
My answer was :

I've already this line (exactly : pid-file "/run/named/named.pid"
/var/run is a symlink to /run

=> I'd already test with /var but it doesn't solve the problem.


With /var/run instead /run, always the same errors:
Code:
# service named status
PID file /var/run/named/named.pid not readable (yet?) after start.


# service named restart
Redirecting to /bin/systemctl restart  named.service
Job for named.service failed because a timeout was exceeded. See "systemctl status named.service" and "journalctl -xe" for details.
Note, I've also change /etc/systemd/system/named.service, adding /var in the PID path
 
Last edited:
Top