FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 04-23-2012, 01:38 PM
Michael Mol
 
Default Postgres suddenly can't access files in its /etc directory

On Mon, Apr 23, 2012 at 9:21 AM, <napalm@squareownz.org> wrote:
> I'm unsure if I should be posting this to the -hardened mailing list as
> I'm using the hardened profile but all of a sudden I'm getting a rather
> strange error when trying to start postgres.
>
> # /etc/init.d/postgresql-9.1 start
> ** Caching service dependencies ... * * * * * * * * * * * * * * * * * * *[ ok ]
> ** The following file(s) are not readable by 'postgres':
> ** * * /etc/postgresql-9.1/postgresql.conf
> ** * * /etc/postgresql-9.1/pg_ident.conf
> ** * * /etc/postgresql-9.1/pg_hba.conf
> ** HINT: Try: 'chmod 644 /etc/postgresql-9.1/*.conf'
> ** ERROR: postgresql-9.1 failed to start
>
> That's what I'm getting when I attempt to start it and I don't seem to have modified anything.
>
> Looking into the init script I can see it's doing su postgres -c "test -r /etc/postgresql-9.1/pg_hba.conf" and the like but the output of:
> * * * *su postgres -c "test -r /etc/postgresql-9.1/pg_hba.conf" || echo "fail"
> is fail... so I'm quite at a loss as to what could be going on here. All of the files are owned by postgres, have the correct permissions (I ran chmod 644 as it hinted) and it should be able to traverse to the directory as everything has the execute bit from /etc onwards.
>
> Any tips?

I tend to go at these things with a bludgeon. Capture and grep the
strace output for syscalls accessing those files, and you can see
exactly what error message the system gives. Or you might see that
it's not looking in the right place.

--
:wq
 
Old 04-23-2012, 02:43 PM
Michael Orlitzky
 
Default Postgres suddenly can't access files in its /etc directory

On 04/23/12 09:21, napalm@squareownz.org wrote:
> I'm unsure if I should be posting this to the -hardened mailing list as
> I'm using the hardened profile but all of a sudden I'm getting a rather
> strange error when trying to start postgres.
>
> # /etc/init.d/postgresql-9.1 start
> * Caching service dependencies ... [ ok ]
> * The following file(s) are not readable by 'postgres':
> * /etc/postgresql-9.1/postgresql.conf
> * /etc/postgresql-9.1/pg_ident.conf
> * /etc/postgresql-9.1/pg_hba.conf
> * HINT: Try: 'chmod 644 /etc/postgresql-9.1/*.conf'
> * ERROR: postgresql-9.1 failed to start
>
> That's what I'm getting when I attempt to start it and I don't seem to have modified anything.
>
> Looking into the init script I can see it's doing su postgres -c "test -r /etc/postgresql-9.1/pg_hba.conf" and the like but the output of:
> su postgres -c "test -r /etc/postgresql-9.1/pg_hba.conf" || echo "fail"
> is fail... so I'm quite at a loss as to what could be going on here. All of the files are owned by postgres, have the correct permissions (I ran chmod 644 as it hinted) and it should be able to traverse to the directory as everything has the execute bit from /etc onwards.
>

You can `su postgres` and then try to read the files yourself. That
should reveal the problem.
 

Thread Tools




All times are GMT. The time now is 12:05 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org