Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l4PZS-0003Q7-LR for pgsql-admin@arkaria.postgresql.org; Tue, 26 Jan 2021 14:43:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l4PZQ-0001FO-QD for pgsql-admin@arkaria.postgresql.org; Tue, 26 Jan 2021 14:43:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l4PZQ-0001FH-GE for pgsql-admin@lists.postgresql.org; Tue, 26 Jan 2021 14:43:52 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l4PZK-0006ZC-9Q for pgsql-admin@postgresql.org; Tue, 26 Jan 2021 14:43:51 +0000 Received: by mail-wm1-x335.google.com with SMTP id u14so2988539wmq.4 for ; Tue, 26 Jan 2021 06:43:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=iL69aTVKV5QgNpJIZJ7UbxhdKf2A+HbD61q8j3Plp7g=; b=GWNCPbnwdOFiXdqZNPc5oVA+iyxAn2dmHjsmR0Ou6X5cOZKMJP/penax0a7hMK5gsu QM8TL98waaMdP8/NZ8eh0CSheFwXaIi9u4o8P/25258cfNJTgEr8BGlPsOVdId5b/10t QC2lRncsXSYAY3tkRJ235/rR6jeYPutSUzbpVOLin4hWJFcwZcslvMm2gJFu8jra4taE LU1ue81sEEUKHoEQTChaAdfTF+MbPazPGMX5lI3+Zfs0905maqgoJXJTBi+/mJdQhlhP p+yAtBkxLoQ4u7/18/li2goIvkwkPBS3ldeXnKFYW5s4oAD1JCQ0AfDYIWrHeAlN0A9u /8NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=iL69aTVKV5QgNpJIZJ7UbxhdKf2A+HbD61q8j3Plp7g=; b=IjvvSgJVf6lNObRQuYJiqMmr8O/wXlGPu4NmDvG0CIqjm4NCEDYfUyXlg/E7eNEp3/ 6O92Ek/6QXN2k8JzVWasir1dCYNWELqOaHFI+LgDwbJIQFJ7iKZJiXgVIKK04MfuRCpZ WhXURilIE3GT9YOluqQe9ztTrSZuWlKeOj7iS0sFQzabIDy0E3tSlO+2HADtMGCVb5fA z+6q768aiRMuatcpBvGtw5o0NNd+rRlQsOv0PyzgEadFzfqExtueZjSAj2iF+vHqkY+V Co+cG8gigIpxZL2nmBuPmyxYwVljGhuQTXPD/B6usudo653L9oJcckTpQgw3fNu/xW+H YgZQ== X-Gm-Message-State: AOAM532xn8x8eLyLjkkOxXTDuL9KtifUcc9yud1tPrgG4YMFucZA3NOn qFhGqemL0V+a5wVdVet0aoM= X-Google-Smtp-Source: ABdhPJxonCHUlSwaISviNfA28RGstM5oBLP0d2Bd+gMPfA6cG3McJWU5n4BTymaM8vowTIxfjBvWDQ== X-Received: by 2002:a1c:25c2:: with SMTP id l185mr97268wml.62.1611672223880; Tue, 26 Jan 2021 06:43:43 -0800 (PST) Received: from [192.168.1.8] (241-57-239-77.dyn.cable.fcom.ch. [77.239.57.241]) by smtp.gmail.com with ESMTPSA id g187sm3811557wmf.1.2021.01.26.06.43.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jan 2021 06:43:43 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) Subject: Re: How to change mode for cluster log? From: =?utf-8?Q?Paul_F=C3=B6rster?= In-Reply-To: Date: Tue, 26 Jan 2021 15:43:42 +0100 Cc: pgsql-admin@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <82C987F7-ADE4-4907-BB98-E36550134D67@gmail.com> References: To: Binghan X-Mailer: Apple Mail (2.3654.40.0.2.32) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi Binghan, > On 26. Jan, 2021, at 15:33, Binghan wrote: >=20 > 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.=20 >=20 > logging_collector =3D off=09 > log_directory =3D '/var/log/postgresql/pg_log' > log_filename =3D 'postgres-event.log' > log_file_mode =3D 0600=09 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=