HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

What does PostgreSQL Status active (exited) mean?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
postgresqlactivewhatmeanstatusdoesexited

Problem

I have PostgreSQL with PostGIS intalled on Ubuntu 22.04.

I can access the PostGIS-Layers from QGIS and work with them.

When i check the status of PostgreSQL with: sudo systemctl status postgresql it returns: Active: active (exited).

My apache has the following status: Active: active (running).
I excpected the same status for PostgreSQL.

So what does this exited mean?

The log file say:

postgres@postgres FATAL:  password authentication failed for user "postgres"
postgres@postgres DETAIL:  User "postgres" has no password assigned.


But im using an other dbname and username, not postgres. So can i ignore this?

Solution

The postgresql service is an "umbrella" service whose purpose is to start or stop the services named postgresql@version-instance which are the actual services that you are interested in.

To get the statuses of these, run sudo systemctl status 'postgresql*'

For instance on my Ubuntu 22.04 system, I have 3 running instances of postgres, which gives the output as follows. You can see that the status of services corresponding to actual PostgreSQL instances is active (running).

$ sudo systemctl status 'postgresql*'
● postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabl>
     Active: active (exited) since Wed 2022-12-07 11:45:54 CET; 3h 13min ago
    Process: 1258 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
   Main PID: 1258 (code=exited, status=0/SUCCESS)
        CPU: 1ms

déc. 07 11:45:54 cyan systemd[1]: Starting PostgreSQL RDBMS...
déc. 07 11:45:54 cyan systemd[1]: Finished PostgreSQL RDBMS.

● postgresql@15-main.service - PostgreSQL Cluster 15-main
     Loaded: loaded (/lib/systemd/system/postgresql@.service; enabled-runtime; vendor pres>
     Active: active (running) since Wed 2022-12-07 11:45:54 CET; 3h 13min ago
    Process: 1006 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 15-main start>
   Main PID: 1173 (postgres)
      Tasks: 6 (limit: 9397)
     Memory: 30.8M
        CPU: 1.208s
     CGroup: /system.slice/system-postgresql.slice/postgresql@15-main.service
             ├─1173 /usr/lib/postgresql/15/bin/postgres -D /var/lib/postgresql/15/main -c >
             ├─1186 "postgres: 15/main: checkpointer " "" "" "" "" "" "" "" "" "" "" "" "">
             ├─1187 "postgres: 15/main: background writer " "" "" "" "" "" "" "" "" "" "" >
             ├─1190 "postgres: 15/main: walwriter " "" "" "" "" "" "" "" "" "" "" "" "" "">
             ├─1192 "postgres: 15/main: autovacuum launcher " "" "" "" "" "" "" "" "" "" ">
             └─1193 "postgres: 15/main: logical replication launcher " "" "" "" "" "" "" ">

déc. 07 11:45:51 cyan systemd[1]: Starting PostgreSQL Cluster 15-main...
déc. 07 11:45:54 cyan systemd[1]: Started PostgreSQL Cluster 15-main.

● postgresql@14-main.service - PostgreSQL Cluster 14-main
     Loaded: loaded (/lib/systemd/system/postgresql@.service; enabled-runtime; vendor pres>
     Active: active (running) since Wed 2022-12-07 11:45:54 CET; 3h 13min ago
    Process: 1005 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 14-main start>
   Main PID: 1170 (postgres)
      Tasks: 7 (limit: 9397)
     Memory: 28.7M
        CPU: 1.338s
     CGroup: /system.slice/system-postgresql.slice/postgresql@14-main.service
             ├─1170 /usr/lib/postgresql/14/bin/postgres -D /var/lib/postgresql/14/main -c >
             ├─1191 "postgres: 14/main: checkpointer " "" "" "" "" "" "" "" "" "" "" "" "">
             ├─1194 "postgres: 14/main: background writer " "" "" "" "" "" "" "" "" "" "" >
             ├─1195 "postgres: 14/main: walwriter " "" "" "" "" "" "" "" "" "" "" "" "" "">
             ├─1196 "postgres: 14/main: autovacuum launcher " "" "" "" "" "" "" "" "" "" ">
             ├─1197 "postgres: 14/main: stats collector " "" "" "" "" "" "" "" "" "" "" "">
             └─1198 "postgres: 14/main: logical replication launcher " "" "" "" "" "" "" ">

déc. 07 11:45:51 cyan systemd[1]: Starting PostgreSQL Cluster 14-main...
déc. 07 11:45:54 cyan systemd[1]: Started PostgreSQL Cluster 14-main.

 postgresql@11-main.service - PostgreSQL Cluster 11-main
     Loaded: loaded (/lib/systemd/system/postgresql@.service; enabled-runtime; vendor pres>
     Active: active (running) since Wed 2022-12-07 11:45:54 CET; 3h 13min ago
    Process: 1004 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 11-main start>
   Main PID: 1169 (postgres)
      Tasks: 7 (limit: 9397)
     Memory: 36.0M
        CPU: 3.656s
     CGroup: /system.slice/system-postgresql.slice/postgresql@11-main.service
             ├─1169 /usr/lib/postgresql/11/bin/postgres -D /var/lib/postgresql/11/main -c >
             ├─1200 "postgres: 11/main: checkpointer   " "" "" "" "" "" "" "" "" "" "" "" >
             ├─1201 "postgres: 11/main: background writer   " "" "" "" "" "" "" "" "" "" ">
             ├─1202 "postgres: 11/main: walwriter   " "" "" "" "" "" "" "" "" "" "" "" "" >
             ├─1203 "postgres: 11/main: autovacuum launcher   " "" "" "" "" "" "" "" "" "">
             ├─1204 "postgres: 11/main: stats collector   " "" "" "" "" "" "" "" "" "" "" >
             └─1205 "postgres: 11/main: logical replication launcher   " "" "" "" "" "" "">

déc. 07 11:45:51 cyan systemd[1]: Starting PostgreSQL Cluster 11-main...
déc. 07 11:45:54 cyan systemd[1]: Started PostgreSQL Cluster 11-main.

Code Snippets

$ sudo systemctl status 'postgresql*'
● postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabl>
     Active: active (exited) since Wed 2022-12-07 11:45:54 CET; 3h 13min ago
    Process: 1258 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
   Main PID: 1258 (code=exited, status=0/SUCCESS)
        CPU: 1ms

déc. 07 11:45:54 cyan systemd[1]: Starting PostgreSQL RDBMS...
déc. 07 11:45:54 cyan systemd[1]: Finished PostgreSQL RDBMS.

● postgresql@15-main.service - PostgreSQL Cluster 15-main
     Loaded: loaded (/lib/systemd/system/postgresql@.service; enabled-runtime; vendor pres>
     Active: active (running) since Wed 2022-12-07 11:45:54 CET; 3h 13min ago
    Process: 1006 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 15-main start>
   Main PID: 1173 (postgres)
      Tasks: 6 (limit: 9397)
     Memory: 30.8M
        CPU: 1.208s
     CGroup: /system.slice/system-postgresql.slice/postgresql@15-main.service
             ├─1173 /usr/lib/postgresql/15/bin/postgres -D /var/lib/postgresql/15/main -c >
             ├─1186 "postgres: 15/main: checkpointer " "" "" "" "" "" "" "" "" "" "" "" "">
             ├─1187 "postgres: 15/main: background writer " "" "" "" "" "" "" "" "" "" "" >
             ├─1190 "postgres: 15/main: walwriter " "" "" "" "" "" "" "" "" "" "" "" "" "">
             ├─1192 "postgres: 15/main: autovacuum launcher " "" "" "" "" "" "" "" "" "" ">
             └─1193 "postgres: 15/main: logical replication launcher " "" "" "" "" "" "" ">

déc. 07 11:45:51 cyan systemd[1]: Starting PostgreSQL Cluster 15-main...
déc. 07 11:45:54 cyan systemd[1]: Started PostgreSQL Cluster 15-main.

● postgresql@14-main.service - PostgreSQL Cluster 14-main
     Loaded: loaded (/lib/systemd/system/postgresql@.service; enabled-runtime; vendor pres>
     Active: active (running) since Wed 2022-12-07 11:45:54 CET; 3h 13min ago
    Process: 1005 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 14-main start>
   Main PID: 1170 (postgres)
      Tasks: 7 (limit: 9397)
     Memory: 28.7M
        CPU: 1.338s
     CGroup: /system.slice/system-postgresql.slice/postgresql@14-main.service
             ├─1170 /usr/lib/postgresql/14/bin/postgres -D /var/lib/postgresql/14/main -c >
             ├─1191 "postgres: 14/main: checkpointer " "" "" "" "" "" "" "" "" "" "" "" "">
             ├─1194 "postgres: 14/main: background writer " "" "" "" "" "" "" "" "" "" "" >
             ├─1195 "postgres: 14/main: walwriter " "" "" "" "" "" "" "" "" "" "" "" "" "">
             ├─1196 "postgres: 14/main: autovacuum launcher " "" "" "" "" "" "" "" "" "" ">
             ├─1197 "postgres: 14/main: stats collector " "" "" "" "" "" "" "" "" "" "" "">
             └─1198 "postgres: 14/main: logical replication launcher " "" "" "" "" "" "" ">

déc. 07 11:45:51 cyan systemd[1]: Starting PostgreSQL Cluster 14-main...
déc. 07 11:45:54 cyan systemd[1]: Started PostgreSQL Cluster 14-main.

 postgresql@11

Context

StackExchange Database Administrators Q#320575, answer score: 8

Revisions (0)

No revisions yet.