Implement support of log.mode. (#3122)

There was one oversight of #2781 - to influence external tools that Patroni could execute, we set global `umask` value based on permissions of the $PGDATA directory. As a result, it also influenced permissions of log files created by Patroni.

To address the problem we implement two measures:
1. Make `log.mode` configurable.
2. If the value is not set - calculate permissions from the original value of the umask setting.
This commit is contained in:
Alexander Kukushkin
2024-08-13 08:11:28 +02:00
committed by GitHub
parent b458bd992a
commit 56dba93c55
9 changed files with 67 additions and 13 deletions
+3
View File
@@ -30,3 +30,6 @@ class TestFilePermissions(unittest.TestCase):
def test_set_permissions_from_data_directory(self, mock_logger):
pg_perm.set_permissions_from_data_directory('test')
self.assertEqual(mock_logger.call_args[0][0], 'Can not check permissions on %s: %r')
def test_orig_umask(self):
self.assertIsNotNone(pg_perm.orig_umask)