[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: postgres install fails on sid



On Sun, Oct 07, 2007 at 16:35:44 +0000, John Masters wrote:
> On 16:04 Sun 07 Oct, Florian Kulzer wrote:
> > On Sun, Oct 07, 2007 at 13:49:11 +0000, John Masters wrote:
> > > I have posted this to the Postgres list also.
> > > 
> > > Cannot get Postgres 8.2 working on Debian sid using the Debian package.
> > > At the config stage I get a message telling me to run:-
> > > 
> > >     pg_createcluster 8.2 main --start
> > > 
> > > Doing this (as root) produces the following output:-
> > > 
> > >     Creating new cluster (configuration: /etc/postgresql/8.2/main, \
> > >     data: /var/lib/postgresql/8.2/main)...
> > >     sh: /dev/null: Permission denied
> > 
> > I would start with the first problem that is reported: "sh: /dev/null:
> > Permission denied". What are the permissions of the /dev/null node on
> > your system? It should be writable by anyone:
> > 
> > $ ls -l /dev/null
> > crw-rw-rw- 1 root root 1, 3 2007-10-07 14:28 /dev/null
> > 
> Thanks, that seems to be the problem. permissions for /dev/null 
> are -rw-r--r--
> 
> What is the c part of the permissions and how do you set it? I have
> googled and searched my books but all I can find is that it is a
> character device file but no mention of how to set the attribute.

The "c" means that it is a special file to begin with; you cannot just
set this property for an existing normal file. Such special files used
to be created with the "mknod" command, but nowadays udev should take
care of their creation.

> Would it be OK to just chmod 666? 

The permission error will probably be gone then, but it would still be a
normal file and not a real /dev/null, which is used to dump the output
of all sorts of commands that are called in scripts. (The job of
/dev/null is to swallow input without a trace.)

I would remove (or rename) the file and run 

udevtrigger

as root, followed by 

echo "xxx" > /dev/null

That should force udev to create the device node. Afterwards you should
see this:

$ file /dev/null
/dev/null: character special (1/3)

If that does not work then something is wrong with your udev
configuration. The first thing to check is if the relevant rules exist:

$ grep null /etc/udev/*
/etc/udev/links.conf:M null             c   1 3
/etc/udev/permissions.rules:KERNEL=="null",                     MODE="0666"

If all else fails then you could try to create the device node yourself
(as root):

mknod -m 0666 /dev/null c 1 3

However, if udev is active it will normally intercept this command and
redirect the device node creation to /dev/.static/dev/null (AFAIK).

-- 
Regards,            | http://users.icfo.es/Florian.Kulzer
          Florian   |



Reply to: