Postgresqll 10: Postgres User /sbin/nologin preventing initdb setup

521 Views Asked by At

I'm attempting to install postgresql 10 for the first time and need to run the initdb setup. Unfortunately, this fails and returns an error from the nologin shell.

server# /usr/pgsql-10/bin/postgresql-10-setup initdb
Initializing database ... 
failed, see /var/lib/pgsql/10/initdb.log
server# cat /var/lib/pgsql/10/initdb.log
This account is currently not available.

I strace'd the command and verified the su commands are probably what's causing this and it seems the default setting for the postgres user is /sbin/nologin. In various examples I've seen, there is no mention of this being a possible issue. How would this work on any other system by default? I feel that temporarily modifying the login shell would work but I want to understand this issue better more specifically from the application's end.

centos 7.8
selinux mode: permissive
postgresql 10

0

There are 0 best solutions below