Comment # 45 on bug 906900 from
(In reply to Bernhard Wiedemann from comment #43)

The env tool does not switch the user, this would require a dirty hack binary
without any pam support, don't know if this would be valid.

Beside this: su has been changed to use pam and systemd will clean sessions at
shutdown.

A solution would be to remove any su or sudo from the postgresql boot script
and move it to e.g. /usr/lib/postgresql/manager

Then create a service unit with something like this

[Service]
Type=forking
User=postgres
PermissionsStartOnly=true
EnvironmentFile=-/etc/sysconfig/postgresql
ExecStartPre=/usr/bin/install -d -o postgres -g postgres -m 700
$POSTGRES_DATADIR
ExecStart=/usr/lib/postgresql/manager start
ExecStop=/usr/lib/postgresql/manager stop
ExecReload=/usr/lib/postgresql/manager reload


You are receiving this mail because: