pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How to change mode for cluster log?
2+ messages / 2 participants
[nested] [flat]

* How to change mode for cluster log?
@ 2021-01-26 14:33  Binghan <binghanluc@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Binghan @ 2021-01-26 14:33 UTC (permalink / raw)
  To: pgsql-admin

Hi,

I have the following configuration in postgresql.conf. However, it only
ensure the mode 600 for file under pg_log. The cluster log file
postgresql-10-main.log has 640. How can control the mode for cluster log in
postgres.

logging_collector = off log_directory = '/var/log/postgresql/pg_log'
log_filename = 'postgres-event.log' log_file_mode = 0600
BRs,
BH

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: How to change mode for cluster log?
@ 2021-01-26 14:43  Paul Förster <paul.foerster@gmail.com>
  parent: Binghan <binghanluc@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Paul Förster @ 2021-01-26 14:43 UTC (permalink / raw)
  To: Binghan <binghanluc@gmail.com>; +Cc: pgsql-admin

Hi Binghan,

> On 26. Jan, 2021, at 15:33, Binghan <binghanluc@gmail.com> wrote:
> 
> I have the following configuration in postgresql.conf. However, it only ensure the mode 600 for file under pg_log. The cluster log file postgresql-10-main.log has 640. How can control the mode for cluster log in postgres. 
> 
> logging_collector = off	
> log_directory = '/var/log/postgresql/pg_log'
> log_filename = 'postgres-event.log'
> log_file_mode = 0600	

you say, your file "postgresql-10-main.log" has 640 but your log_filename is "postgres-event.log". So the file "postgresql-10-main.log" is something else which your setup generates elsewhere.

In any event, you can enforce read/write permissions for a user only by setting its umask to 0077. Don't forget to change the permissions of your log file. The umask command does not change that!

Your should also make the setting persistent, for example in the profile of user postgres.

Cheers,
Paul




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2021-01-26 14:43 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-01-26 14:33 How to change mode for cluster log? Binghan <binghanluc@gmail.com>
2021-01-26 14:43 ` Paul Förster <paul.foerster@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox