Re: postgresql-ctl systemd failed: permission denied - Mailing list pgsql-general

From arnaud gaboury
Subject Re: postgresql-ctl systemd failed: permission denied
Date
Msg-id CAK1hC9vc6DktqbOjR+BzKdm7ihn2kn73Vr3vvaSLwgRitP7WXA@mail.gmail.com
Whole thread Raw
In response to Re: postgresql-ctl systemd failed: permission denied  (CaT <cat@zip.com.au>)
List pgsql-general


On Tue, Jul 28, 2015 at 1:43 PM, CaT <cat@zip.com.au> wrote:
On Tue, Jul 28, 2015 at 01:31:29PM +0200, arnaud gaboury wrote:
> On Tue, Jul 28, 2015 at 1:26 PM, Francisco Olarte <folarte@peoplecall.com>
> wrote:
>
> > Hi Arnaud...
> >
> > On Tue, Jul 28, 2015 at 12:13 PM, arnaud gaboury
> > <arnaud.gaboury@gmail.com> wrote:
> > > On Fedora 22
> > ...
> > > Jul 28 11:49:57 poppy postgresql-ctl[307]: FATAL:  42501: could not
> > > open log file "/storage/log/postgresql/postgresql-Tue.log": Permission
> > > denied
> > > Jul 28 11:49:57 poppy postgresql-ctl[307]: LOCATION:  logfile_open,
> > > syslogger.c:1160
> > > Jul 28 11:50:01 poppy postgresql-ctl[307]: pg_ctl: could not start server
> > > ----------------------------------------------------------------
> >
> > > % ls -al /storage/log
> > > drwxr-xr-x 1 postgres postgres    0 Jul 28 11:29 postgresql/
> >
> > May be stating the obvious, but can you try 'touch
> > /storage/log/postgresql/postgresql-Tue.log" as postgres to see it it
> > works.
>
> % ls -al /storage/log/postgresql
> total 0
> drwxrwxr-x 1 postgres postgres  36 Jul 28 13:27 ./
> drwxr-x--- 1 root     wheel    208 Jul 27 13:34 ../
> -rw-rw-r-- 1 postgres postgres   0 Jul 28 13:27 postgresql-Tue.log
>
> Still permission denied

If the logfile is being written to as the user postgres then .. is what
is preventing it. Only root and wheel have access so unless postgres is
in group wheel you need to

chmod o+x /storage/log at least.

 % ls -al postgresql 
total 0
drwxrwxr-x 1 postgres postgres  36 Jul 28 13:27 ./
drwxr-x--x 1 root     wheel    208 Jul 27 13:34 ../
-rw-rw-r-x 1 postgres postgres   0 Jul 28 13:27 postgresql-Tue.log*

% sudo systemctl status postgresql
...............
Jul 28 13:47:40 poppy systemd[1]: Started PostgreSQL database server.

Thank you so much. Again, permission story 


--
  "A search of his car uncovered pornography, a homemade sex aid, women's
  stockings and a Jack Russell terrier."
    - http://www.dailytelegraph.com.au/news/wacky/indeed/story-e6frev20-1111118083480



--

pgsql-general by date:

Previous
From: arnaud gaboury
Date:
Subject: Re: postgresql-ctl systemd failed: permission denied
Next
From: "Furlong, Shane"
Date:
Subject: Error: "When checking a pre-PG 9.1 live old server, you must specify the old server's port number."