[gentoo-user] OT - Weird Permissions error

2005-12-12 Thread Michael Sullivan
I'm having a strange problem.  I set up a DNS server for my domain
today, and when I tried to start it, it wouldn't start.  I consulted the
log files and found this:

Dec 12 15:51:38 bullet named[7707]: starting BIND 9.2.5 -u named -n 1
Dec 12 15:51:38 bullet named[7707]: using 1 CPU
Dec 12 15:51:39 bullet named[7709]: loading configuration from
'/etc/bind/named.conf'
Dec 12 15:51:39 bullet named[7709]: listening on IPv4 interface lo,
127.0.0.1#53
Dec 12 15:51:39 bullet named[7709]: listening on IPv4 interface eth0,
192.168.1.2#53
Dec 12 15:51:39 bullet named[7709]: command channel listening on
127.0.0.1#953
Dec 12 15:51:39 bullet named[7709]: couldn't open pid file
'/var/run/named.pid': Permission denied
Dec 12 15:51:39 bullet named[7709]: exiting (due to early fatal error)

When I was trying to start the named server I did so as the root user.
I checked the permissions on /var/run:

bullet log # ls -l /var
total 48
drwxr-xr-x   4 named named 4096 Dec 12 14:13 bind
drwxr-xr-x   7 root  root  4096 Sep 25 12:55 cache
drwxr-xr-x   4 root  root  4096 Sep  6 07:04 db
drwxr-xr-x   2 root  root  4096 Mar 10  2005 empty
drwxr-xr-x  19 root  root  4096 Dec 11 00:49 lib
drwxrwxr-x   3 root  uucp  4096 Nov 27 09:31 lock
drwxr-xr-x   9 root  root  4096 Dec 12 15:52 log
lrwxrwxrwx   1 root  root15 Jul  5 17:56 mail - /var/spool/mail
drwxr-xr-x  10 root  root  4096 Dec 12 15:51 run
drwxr-xr-x   9 root  root  4096 Sep 28 13:09 spool
drwxr-xr-x   2 root  root  4096 Mar 10  2005 state
drwxrwxrwt   5 root  root  4096 Dec 12 14:41 tmp
drwxr-xr-x   4 root  root  4096 Jul  3 04:14 www

As you can see the run directory is 755, which should be acceptible -
not to mention that it was the root account that was trying to start
named.  I checked inside /var/run itself:

bullet log # ls -l /var/run
total 72
-rw-r--r--  1 root   root 5 Dec 12 14:57 apache2.pid
srwx--  1 apache root 0 Dec 12 14:57 cgisock
drwxr-xr-x  2 root   root  4096 Oct 28 15:32 console
-rw-r--r--  1 root   root 6 Dec  4 09:18 cron.pid
drwx--  3 root   root  4096 Dec 12 14:42 dovecot
drwxr-xr-x  2 mysql  mysql 4096 Dec 11 17:21 mysqld
drwxr-xr-x  2 named  named 4096 Dec 12 14:13 named
-rw-r--r--  1 root   root 4 Nov 27 14:32 ntpd.pid
drwxr-xr-x  2 ldap   ldap  4096 Dec 11 00:47 openldap
-rw---  1 root   root   512 Nov 27 09:31 random-seed
-rw-r--r--  1 nobody root 5 Dec 10 22:14 rpc.statd.pid
drwxr-xr-x  2 root   root  4096 Nov 27 14:32 samba
drwxr-xr-x  4 root   utmp  4096 Dec  1 16:26 screen
-rw---  1 root   smmsp   45 Dec 12 09:43 sendmail.pid
-rw-r--r--  1 root   root 5 Nov 27 09:31 sshd.pid
-rw---  1 root   root 5 Dec 12 15:52 syslog-ng.pid
drwxr-xr-x  2 root   root  4096 Jul  5 16:58 usb
-rw-rw-r--  1 root   utmp  6144 Dec 12 14:33 utmp

There is a named directory there, but it's empty.  I assume that it was
automatically created when I emerged bind early this afternoon.  Any
thoughts on what's causing this error?

-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] OT - Weird Permissions error

2005-12-12 Thread Jonathan Nichols



Dec 12 15:51:39 bullet named[7709]: couldn't open pid file
'/var/run/named.pid': Permission denied



drwxr-xr-x  2 named  named 4096 Dec 12 14:13 named

There is a named directory there, but it's empty.  I assume that it was
automatically created when I emerged bind early this afternoon.  Any
thoughts on what's causing this error?



It's trying to put the pid file in /var/run - you need to change 
named.conf to have it put it in /var/run/named instead


in named.conf:

pid-file /var/run/named/named.pid;

That should solve that problem for you.


--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] OT - Weird Permissions error

2005-12-12 Thread kashani

Michael Sullivan wrote:

I'm having a strange problem.  I set up a DNS server for my domain
today, and when I tried to start it, it wouldn't start.  I consulted the
log files and found this:

Dec 12 15:51:39 bullet named[7709]: couldn't open pid file
'/var/run/named.pid': Permission denied
Dec 12 15:51:39 bullet named[7709]: exiting (due to early fatal error)


 big ol snip 

The startup script drops its privileges to user named. I'm guessing it 
does that before it writes the pid file. To fix you'll want to add this 
line to your named.conf file in the options area.


pid-file /var/run/named/named.pid;

I may have also editted the /etc/init.d/named file to point to that file 
as well. This might not need to be done depending on which Bind ebuild 
you used.


For these and other ways to fix the somewhat retarded default Bind 
install, like the named/bind naming nonsene, you might want to check the 
wiki article.


http://gentoo-wiki.com/HOWTO_Setup_a_DNS_Server_with_BIND

kashani
--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] OT - Weird Permissions error

2005-12-12 Thread Michael Sullivan
On Mon, 2005-12-12 at 14:03 -0800, Jonathan Nichols wrote:
  Dec 12 15:51:39 bullet named[7709]: couldn't open pid file
  '/var/run/named.pid': Permission denied
 
  drwxr-xr-x  2 named  named 4096 Dec 12 14:13 named
  
  There is a named directory there, but it's empty.  I assume that it was
  automatically created when I emerged bind early this afternoon.  Any
  thoughts on what's causing this error?
  
 
 It's trying to put the pid file in /var/run - you need to change 
 named.conf to have it put it in /var/run/named instead
 
 in named.conf:
 
 pid-file /var/run/named/named.pid;
 
 That should solve that problem for you.
 

Dec 12 16:12:41 bullet named[9069]: starting BIND 9.2.5 -u named -n 1
Dec 12 16:12:41 bullet named[9069]: using 1 CPU
Dec 12 16:12:41 bullet named[9071]: loading configuration from
'/etc/bind/named.conf'
Dec 12 16:12:41 bullet named[9071]: /etc/bind/named.conf:15: unknown
option 'pid-file'
Dec 12 16:12:41 bullet named[9071]: loading configuration: failure
Dec 12 16:12:41 bullet named[9071]: exiting (due to fatal error)

Here's my /etc/bind/named.conf:

bullet log # cat /etc/bind/named.conf
options {
directory /etc/bind;
};

zone espersunited.com in {
type master;
file db.espersunited.com;
};

zone . in {
type hint;
file db.cache;
};

pid-file /var/run/named/named.pid;

It still won't start.

-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] OT - Weird Permissions error

2005-12-12 Thread kashani

Michael Sullivan wrote:

bullet log # cat /etc/bind/named.conf
options {
directory /etc/bind;
};

zone espersunited.com in {
type master;
file db.espersunited.com;
};

zone . in {
type hint;
file db.cache;
};

pid-file /var/run/named/named.pid;

It still won't start.



options {
directory /etc/bind;
pid-file /var/run/named/named.pid;
}

is the correct syntax.

kashani
--
gentoo-user@gentoo.org mailing list