LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-24-2002, 05:23 PM   #1
morbo
Member
 
Registered: Dec 2001
Posts: 53

Rep: Reputation: 15
Named can't create .pid?!?!?


Ok, Im trying to get BIND 9.2 to run on my Redhat 7.1 box, and all is working possibly ok except for 1 thing.....

Named starts up just fine from xinetd, no problems at all. however if I kill it and do:

/usr/sbin/named

My /var/log/messages reads:
Sep 24 16:23:49 ns3 named[1123]: starting BIND 9.2.1
Sep 24 16:23:49 ns3 named[1123]: using 1 CPU
Sep 24 16:23:49 ns3 named[1125]: loading configuration from '/etc/named.conf'
Sep 24 16:23:49 ns3 named[1125]: no IPv6 interfaces found
Sep 24 16:23:49 ns3 named[1125]: listening on IPv4 interface lo, 127.0.0.1#53
Sep 24 16:23:49 ns3 named[1125]: listening on IPv4 interface eth0, 204.57.74.90#53
Sep 24 16:23:49 ns3 named[1125]: command channel listening on 127.0.0.1#953
Sep 24 16:23:49 ns3 named[1125]: couldn't open pid file '/var/run/named/named.pid': Permission denied
Sep 24 16:23:49 ns3 named[1125]: exiting (due to early fatal error)

So, I have no idea what to do, I have several other pids in there (ssh, and a few others) but I can't get named to start from the command line-but if i reboot the server it starts up fine. Anyone have any ideas? Im stumped!
 
Old 09-24-2002, 05:27 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well does the file not exist already? there might be a stale one without permissions to it. who are you running the server as? do they have rights? how are you running it from the command line?
 
Old 09-24-2002, 05:42 PM   #3
morbo
Member
 
Registered: Dec 2001
Posts: 53

Original Poster
Rep: Reputation: 15
Running as root and i did a 'find / -name named.pid'

and found nothing.....

Im using the command:
/usr/sbin/named

Last edited by morbo; 09-24-2002 at 05:43 PM.
 
Old 09-24-2002, 11:44 PM   #4
RijilV
Member
 
Registered: Sep 2002
Location: somewhere
Distribution: gentoo
Posts: 123

Rep: Reputation: 15
as any user, do:

ls -l /var/run/named/named.pid

check the user/group on that file, if it is something other than root run named like

/usr/sbin/named -gu <username>

now, try to understand what user named is running as, you might want to read the DNS howto located at tldp.org


if that file doesn't exist for whatever reason, despite your error message claiming otherwise, do:

touch /var/run/named/named.pid

be warned! running named as root is a Bad Idea
 
Old 09-25-2002, 12:43 AM   #5
morbo
Member
 
Registered: Dec 2001
Posts: 53

Original Poster
Rep: Reputation: 15
What do you mean understand what username? The username is 'named', apparently he doesn't have permission to the named.pid, what should the file permissions be for the named.pid ?
 
Old 09-25-2002, 12:58 AM   #6
RijilV
Member
 
Registered: Sep 2002
Location: somewhere
Distribution: gentoo
Posts: 123

Rep: Reputation: 15
Quote:
Originally posted by morbo
What do you mean understand what username? The username is 'named', apparently he doesn't have permission to the named.pid, what should the file permissions be for the named.pid ?

understand why named is running as such, figure out if said usename is in the passwd file, and such

named is probably changing to the user nobody at started. add the -u named to the command will fix that.


I was trying to show him the answer, not tell him.

named.pid should be 600, owned by whatever user you want named to run as (typically named).
 
Old 09-25-2002, 01:17 AM   #7
morbo
Member
 
Registered: Dec 2001
Posts: 53

Original Poster
Rep: Reputation: 15
Oh I thought that went without saying =)

I understand the basics of file perms, users, and groups

named starts up as named, and runs as named not 'nobody' (like say apache or my bnc or eggdrop bot). The file named.pid was set to 544, chaning it to 600 didnt work.....


like i said it runs FINE at startup, but if i kill it and try to run it/usr/sbin named i get that in my /var/msg/log it doesnt say ANYTHING at the prompt.....
 
Old 09-25-2002, 01:33 AM   #8
RijilV
Member
 
Registered: Sep 2002
Location: somewhere
Distribution: gentoo
Posts: 123

Rep: Reputation: 15
Quote:
Originally posted by morbo

like i said it runs FINE at startup, but if i kill it and try to run it/usr/sbin named i get that in my /var/msg/log it doesnt say ANYTHING at the prompt.....
named won't say anything at the prompt

to get error messages display and not logged, and run named in the forground, run

named -g


try running

named -gu named
 
Old 09-25-2002, 01:46 AM   #9
morbo
Member
 
Registered: Dec 2001
Posts: 53

Original Poster
Rep: Reputation: 15
\that worked! running it as named -gu named worked, so i took the g off (named -u named) and tada, thanks Im not sure why I didnt think of that one myself =)
 
Old 09-25-2002, 03:08 AM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you should run it as a proper service anyway

service start named

or

/etc/init.d/named start
 
Old 09-25-2002, 03:21 AM   #11
mikek147
Member
 
Registered: Mar 2002
Location: Elyria, Ohio
Distribution: Debian, Nothing else required
Posts: 141

Rep: Reputation: 15
If you're kill named because you made changes in named's database, instead of killing it, do:

kill -1 <named-pid>

This will force named to re-read all it's configuration files. -mk
 
Old 09-11-2006, 02:53 AM   #12
traineetux
LQ Newbie
 
Registered: Aug 2006
Distribution: fedora core 6
Posts: 7

Rep: Reputation: 0
yes!!

Quote:
Originally Posted by RijilV
named won't say anything at the prompt

to get error messages display and not logged, and run named in the forground, run
named -g

try running
named -gu named
thanks dude! i was about to post on a new thread but your guide helped me out! greatly appreciated!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to make a program create a pid file? blk96gt Slackware 1 10-29-2004 11:59 AM
How do i create named.conf file pkrishna10 Linux - Wireless Networking 2 10-22-2004 12:54 PM
/var/run/[XXX].pid - Tcl pid code liguorir Linux - Software 1 05-20-2004 10:32 PM
How can I create a pid file from a backgournd process that I start? Hackiller Linux - General 3 05-12-2004 02:37 PM
[named/DNS] How do you create subdomains? BxBoy Linux - Networking 7 01-12-2003 09:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration