Postgres not turning on

ystemctl status postgresql-17.service
× postgresql-17.service - PostgreSQL 17 database server
Loaded: loaded (/usr/lib/systemd/system/postgresql-17.service; enabled; preset: disabled)
Drop-In: /usr/lib/systemd/system/service.d
└─10-timeout-abort.conf, 50-keep-warm.conf
Active: failed (Result: exit-code) since Fri 2025-04-11 18:19:46 CEST; 31s ago
Invocation: f44a3e3e544141cf8cf45be78aa78d22
Docs: PostgreSQL: Documentation: 17: PostgreSQL 17.4 Documentation
Process: 20433 ExecStartPre=/usr/pgsql-17/bin/postgresql-17-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
Process: 20439 ExecStart=/usr/pgsql-17/bin/postgres -D ${PGDATA} (code=exited, status=1/FAILURE)
Main PID: 20439 (code=exited, status=1/FAILURE)
Mem peak: 13.7M
CPU: 50ms

apr 11 18:19:46 pingvinska-masina systemd[1]: Starting postgresql-17.service - PostgreSQL 17 database server…
apr 11 18:19:46 pingvinska-masina postgres[20439]: 2025-04-11 18:19:46.142 CEST [20439] LOG: redirecting log output to logging collector process
apr 11 18:19:46 pingvinska-masina postgres[20439]: 2025-04-11 18:19:46.142 CEST [20439] HINT: Future log output will appear in directory “log”.
apr 11 18:19:46 pingvinska-masina systemd[1]: postgresql-17.service: Main process exited, code=exited, status=1/FAILURE
apr 11 18:19:46 pingvinska-masina systemd[1]: postgresql-17.service: Killing process 20440 (postgres) with signal SIGKILL.
apr 11 18:19:46 pingvinska-masina systemd[1]: postgresql-17.service: Failed with result ‘exit-code’.
apr 11 18:19:46 pingvinska-masina systemd[1]: Failed to start postgresql-17.service - PostgreSQL 17 database server.

That doesn’t appear to be a standard Fedora Linux Postgres installation. It should be under /usr/bin/postgres.

$ rpm -qf /usr/bin/postgres
postgresql-server-16.3-3.fc41.x86_64

SELinux might be blocking non-standard installations. (Among many other potential problems.)

1 Like

PostgreSQL 16.8 seems fine on F42:

sudo dnf install 'postgresql-server'
sudo postgresql-setup --initdb
sudo systemctl start 'postgresql'
sudo systemctl status 'postgresql'
● postgresql.service - PostgreSQL database server
     Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled; preset: disabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf, 50-keep-warm.conf
     Active: active (running) since Fri 2025-04-11 17:48:58 EDT; 2min 24s ago
 Invocation: 081ba1cefaec49609ccf16894b43c1ed
    Process: 48476 ExecStartPre=/usr/libexec/postgresql-check-db-dir postgresql (code=exited, status=0/SUCCESS)
   Main PID: 48478 (postgres)
      Tasks: 7 (limit: 18819)
     Memory: 19.3M (peak: 22.4M)
        CPU: 66ms
     CGroup: /system.slice/postgresql.service
             ├─48478 /usr/bin/postgres -D /var/lib/pgsql/data
             ├─48480 "postgres: logger "
             ├─48481 "postgres: checkpointer "
             ├─48482 "postgres: background writer "
             ├─48484 "postgres: walwriter "
             ├─48485 "postgres: autovacuum launcher "
             └─48486 "postgres: logical replication launcher "

Apr 11 17:48:58 fedora systemd[1]: Starting postgresql.service - PostgreSQL database server...
Apr 11 17:48:58 fedora postgres[48478]: 2025-04-11 17:48:58.221 EDT [48478] LOG:  redirecting log output to logging collector process
Apr 11 17:48:58 fedora postgres[48478]: 2025-04-11 17:48:58.221 EDT [48478] HINT:  Future log output will appear in directory "log".
Apr 11 17:48:58 fedora systemd[1]: Started postgresql.service - PostgreSQL database server.

postgresql17-server works too same way (no 17 does 16.8; needed to rm -Rf /var/lib/pgsql when switching)

postgresql17-server is in default Fedora 42 repos. PostgreSQL’s own repo had 404s for F42 and I wouldn’t recommend using it.

1 Like