Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

When I try to restart / start the named service, it keeps failing.

service named restart

Results in:-

Stopping named:                                            [  OK  ]
Starting named:
Error in named configuration:
/etc/named.conf:2: missing ';' before '}'
                                                           [FAILED]

service named start

Results in:-

Starting named:
Error in named configuration:
/etc/named.conf:2: missing ';' before '}'
                                                           [FAILED]

The thing is, even if named.conf contains no syntax errors or even if the file doesn't exist at all, I'm still getting this error preventing me from starting the service.

Currently trying with a named.conf containing the following:-

options {
listen-on port 53 { 127.0.0.1; };
};

And checking the syntax of named.conf using

named-checkconf /etc/named.conf

Results in no errors. Yet when starting the service, I still get the above error.

I can't see any other errors in the logs relating to this and don't really know where to get to the bottom of this. Any ideas?

(Even reverting back to the named.conf file that was in place before I stopped the service returns the same error now and this was previously running fine).

Contents on init.d/named can be seen at this pastebin.

CentOS 6.4 - Linux version 2.6.32-358.6.2.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Thu May 16 20:59:36 UTC 2013

Update

bash -x /etc/init.d/named start

Snippet from results possibly of relevance?

+ echo 'Error in named configuration:'
Error in named configuration:
+ echo '/etc/named.conf:2: missing '\'';'\'' before '\''}'\'''
/etc/named.conf:2: missing ';' before '}'
+ failure
+ local rc=0
+ '[' color '!=' verbose -a -z '' ']'
+ echo_failure
+ '[' color = color ']'
+ echo -en '\033[60G'
                                                           + echo -n '['
[+ '[' color = color ']'
+ echo -en '\033[0;31m'
+ echo -n FAILED
FAILED+ '[' color = color ']'
+ echo -en '\033[0;39m'
+ echo -n ']'
]+ echo -ne '\r'
+ return 1
+ '[' -x /bin/plymouth ']'
+ /bin/plymouth --details
+ return 0
+ echo
share|improve this question
    
have you watch the script that probably exists in /etc/init.d/named ? the errors probably come from there –  Kiwy Mar 11 at 11:19
    
Even though it specifically states /etc/named.conf file? (I've run a named-checkconfig on /etc/init.d/named as well but nothing flagged that would prevent service from starting). Thanks. –  zigojacko Mar 11 at 11:24
1  
@GeoffJackson-zigojacko yes, the service command does not execute /etc/named.conf it probably executes /etc/init.d/named, and that you cannot check with named-checkconf as it is not a named config file. –  Anthon Mar 11 at 11:31
1  
@GeoffJackson-zigojacko what is your distribution? (Add a tag to the question). –  Anthon Mar 11 at 11:32
    
I see, thanks @Anthon (distro CentOS 6.4 - full version added above). What would be the process to check for issues in /etc/init.d/named please? –  zigojacko Mar 11 at 11:39

1 Answer 1

up vote 1 down vote accepted

Okay, so I managed to resolve this by changing one line in /etc/init.d/named:-

Line 29 in /etc/init.d/named changed from...

named='named'

To...

named='named -u named'

Then service would start back up again without issue. Nothing like a misleading error message!

Sigh.

share|improve this answer
    
it's nice that you find a solution. –  Kiwy Mar 11 at 12:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.