1

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

  • 1
    How was user `postgres` created? It should have `/bin/bash` as shell. – Philippe Jun 13 '20 at 18:53
  • 1
    The default shell is /bin/bash,and it is created by the package. I just tried in a fresh docker container and the /etc/passwd entry is : `postgres:x:26:26:PostgreSQL Server:/var/lib/pgsql:/bin/bash` – Axelinux Jun 13 '20 at 18:56

0 Answers0