From: Paul Förster <paul.foerster@gmail.com>
To: Binghan <binghanluc@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: How to change mode for cluster log?
Date: Tue, 26 Jan 2021 15:43:42 +0100
Message-ID: <82C987F7-ADE4-4907-BB98-E36550134D67@gmail.com> (raw)
In-Reply-To: <CA+GVamEFyj1v8aRFPGmC3YXVUqJOodKV1PhHV4ETmUA5Ut0-Gw@mail.gmail.com>
References: <CA+GVamEFyj1v8aRFPGmC3YXVUqJOodKV1PhHV4ETmUA5Ut0-Gw@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: paul.foerster@gmail.com, binghanluc@gmail.com
Subject: Re: How to change mode for cluster log?
In-Reply-To: <82C987F7-ADE4-4907-BB98-E36550134D67@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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