Thread: Logfile permissions

Logfile permissions

From
Thomas Guettler
Date:
Hi,

my logfiles all have this permission:

-rw------- 1 postgres postgres    14841 10. Feb 08:52
postgresql-2009-02-10_000000.log

Is it possible that postgres creates group readable files? I want to
monitor this logfile, but
for security I don't want to use the postgres user for this.

I looked at this documentation and could not find a solution:
   http://www.postgresql.org/docs/8.2/static/runtime-config-logging.html

I use this settings:

  log_destination = 'stderr'
  redirect_stderr = on


Since the server is linux, I could use syslog, too. But somehow I want
to stay with the defaults (SuSE).

How do you check your logfiles?


  Thomas Güttler

--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de


Re: Logfile permissions

From
Jasen Betts
Date:
On 2009-02-10, Thomas Guettler <hv@tbz-pariv.de> wrote:
> Hi,
>
> my logfiles all have this permission:
>
> -rw------- 1 postgres postgres    14841 10. Feb 08:52
> postgresql-2009-02-10_000000.log
>
> Is it possible that postgres creates group readable files?

you could patch and recompile the source.

But it may be easier to create the logfile with the permissions you
want before starting postgres. (you can do that in the init.d script
that launches postgres)