Linux Mint 20.2
Postgresql 9.6.
Steps:
sudo systemctl enable postgresql.service
Result:
Synchronizing state of postgresql.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable postgresql
Then restart service like this:
sudo service postgresql restart
And when check status like this:
service postgresql status
I get this:
postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: active (exited) since Wed 2021-08-04 17:33:34 EEST; 47s ago
Process: 29261 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 29261 (code=exited, status=0/SUCCESS)
Why service is EXITED ?
here content of /var/log/postgresql/postgresql-9.6-main.log
2021-08-05 14:59:14.739 EEST [116538] LOG: database system was shut down at 2021-08-05 14:59:13 EEST
2021-08-05 14:59:14.741 EEST [116538] LOG: MultiXact member wraparound protections are now enabled
2021-08-05 14:59:14.746 EEST [116537] LOG: database system is ready to accept connections
2021-08-05 14:59:14.746 EEST [116542] LOG: autovacuum launcher started
2021-08-05 14:59:15.210 EEST [116544] [unknown]@[unknown] LOG: incomplete startup packet
2021-08-05 14:59:55.996 EEST [116537] LOG: received fast shutdown request
2021-08-05 14:59:55.996 EEST [116537] LOG: aborting any active transactions
2021-08-05 14:59:55.997 EEST [116542] LOG: autovacuum launcher shutting down
2021-08-05 14:59:55.998 EEST [116539] LOG: shutting down
2021-08-05 14:59:56.037 EEST [116537] LOG: database system is shut down
2021-08-05 14:59:57.069 EEST [119294] LOG: database system was shut down at 2021-08-05 14:59:56 EEST
2021-08-05 14:59:57.072 EEST [119294] LOG: MultiXact member wraparound protections are now enabled
2021-08-05 14:59:57.073 EEST [119299] LOG: autovacuum launcher started
2021-08-05 14:59:57.073 EEST [119290] LOG: database system is ready to accept connections
2021-08-05 14:59:57.549 EEST [119301] [unknown]@[unknown] LOG: incomplete startup packet
2021-08-05 15:03:46.004 EEST [119290] LOG: received fast shutdown request
2021-08-05 15:03:46.004 EEST [119290] LOG: aborting any active transactions
2021-08-05 15:03:46.004 EEST [119299] LOG: autovacuum launcher shutting down
2021-08-05 15:03:46.005 EEST [119296] LOG: shutting down
2021-08-05 15:03:46.018 EEST [119290] LOG: database system is shut down
2021-08-05 15:03:47.070 EEST [119631] LOG: database system was shut down at 2021-08-05 15:03:46 EEST
2021-08-05 15:03:47.072 EEST [119631] LOG: MultiXact member wraparound protections are now enabled
2021-08-05 15:03:47.074 EEST [119630] LOG: database system is ready to accept connections
2021-08-05 15:03:47.074 EEST [119639] LOG: autovacuum launcher started
2021-08-05 15:03:47.557 EEST [119642] [unknown]@[unknown] LOG: incomplete startup packet
here another command:
pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
9.6 main 5432 online postgres /var/lib/postgresql/9.6/main /var/log/postgresql/postgresql-9.6-main.log
one more command:
sudo pg_isready
/var/run/postgresql:5432 - accepting connections