After some attempts to change permissions to access pqsql
and data
in /var/lib/pgsql/data/
my postgres-server failed.
Postgresql status is:
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Ср 2020-02-05 12:46:48 MSK; 2min 19s ago Process: 572 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t 300 (code=exited, status=1/FAILURE) Process: 564 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS) plesk.iline.pro systemd[1]: Starting PostgreSQL database server... plesk.iline.pro pg_ctl[572]: FATAL: data directory "/var/lib/pgsql/data" has wrong ownership plesk.iline.pro pg_ctl[572]: HINT: The server must be started by the user that owns the data directory. plesk.iline.pro pg_ctl[572]: pg_ctl: could not start server plesk.iline.pro pg_ctl[572]: Examine the log output. plesk.iline.pro systemd[1]: postgresql.service: control process exited, code=exited status=1 plesk.iline.pro systemd[1]: Failed to start PostgreSQL database server. plesk.iline.pro systemd[1]: Unit postgresql.service entered failed state. plesk.iline.pro systemd[1]: postgresql.service failed.
In journalctl -xe
I see:
input_userauth_request: invalid user isp [preauth] plesk.iline.pro sshd[17416]: pam_unix(sshd:auth): check pass; user unknown plesk.iline.pro sshd[17416]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=118.25.105.121 plesk.iline.pro dreamwhiteApi[4034]: 2020/02/05 12:15:02 Requesting: GET https://online.moysklad.ru/api/remap/1.1/entity/employee/? plesk.iline.pro postfix/postdrop[1048]: warning: mail_queue_enter: create file maildrop/663461.1048: Permission denied plesk.iline.pro postfix/postdrop[25484]: warning: mail_queue_enter: create file maildrop/739287.25484: Permission denied
I return rights to initial state:
drwxr-xr-x 4 postgres postgres 4096 pgsql drwxr-xr-x 15 polkitd postgres 4096 data
But the problem remains.
Postgresql-vertion is 9.2 (I can't change this version for some reasons in my server).
ls
output what pokitd is, as it may depend on the options you passed tols
. My best guess is that it is some user name. If so "/var/lib/pgsql/data" needs postgres user as owner, not polkitd