Score:0

Postgres is shutting down after some hours on Ubuntu

my flag

On an Ubuntu Server I have a Postgres database but its always shutting down after some time if it's not used.

My latest postgresql logs look like this:

Sep 17 12:38:01 localhost systemd[1]: postgresql.service: Succeeded.
Sep 17 12:38:01 localhost systemd[1]: Stopped PostgreSQL RDBMS.
Sep 17 12:38:01 localhost systemd[1]: Stopping PostgreSQL RDBMS...
Sep 17 12:38:04 localhost systemd[1]: Starting PostgreSQL RDBMS...
Sep 17 12:38:04 localhost systemd[1]: Finished PostgreSQL RDBMS.
Sep 18 12:07:50 localhost systemd[1]: postgresql.service: Succeeded.
Sep 18 12:07:50 localhost systemd[1]: Stopped PostgreSQL RDBMS.
Sep 18 12:07:50 localhost systemd[1]: Stopping PostgreSQL RDBMS...
Sep 18 12:07:53 localhost systemd[1]: Starting PostgreSQL RDBMS...
Sep 18 12:07:53 localhost systemd[1]: Finished PostgreSQL RDBMS.
Sep 21 16:24:55 localhost systemd[1]: postgresql.service: Succeeded.
Sep 21 16:24:55 localhost systemd[1]: Stopped PostgreSQL RDBMS.
Sep 21 16:24:55 localhost systemd[1]: Stopping PostgreSQL RDBMS...
Sep 21 16:24:55 localhost systemd[1]: Starting PostgreSQL RDBMS...
Sep 21 16:24:55 localhost systemd[1]: Finished PostgreSQL RDBMS.
Sep 21 16:33:18 localhost systemd[1]: postgresql.service: Succeeded.
Sep 21 16:33:18 localhost systemd[1]: Stopped PostgreSQL RDBMS.
Sep 21 16:33:18 localhost systemd[1]: Stopping PostgreSQL RDBMS...
Sep 21 16:33:19 localhost systemd[1]: Starting PostgreSQL RDBMS...
Sep 21 16:33:19 localhost systemd[1]: Finished PostgreSQL RDBMS.
Sep 21 16:34:05 localhost systemd[1]: postgresql.service: Succeeded.
Sep 21 16:34:05 localhost systemd[1]: Stopped PostgreSQL RDBMS.
Sep 21 16:34:05 localhost systemd[1]: Stopping PostgreSQL RDBMS...
Sep 21 16:34:05 localhost systemd[1]: Starting PostgreSQL RDBMS...
Sep 21 16:34:05 localhost systemd[1]: Finished PostgreSQL RDBMS.

If I call pg_lsclusters after the DB is not available it says this:

Ver Cluster Port Status Owner    Data directory              Log file
12  main    5432 down   postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log

Ubuntu version: Ubuntu 20.04.3 LTS | PostgreSQL verstion: 12.8

Michael Hampton avatar
cz flag
Check the logs.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.