Postgres immediately closing connection when `systemctl reboot` command is fired.

From: Raghvendra Mishra <raghshr1351(at)gmail(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Postgres immediately closing connection when `systemctl reboot` command is fired.
Date: 2025-09-04 08:59:44
Message-ID: CABZ0CP9YWCdNs3h493R5wuci4scRrQjrPHW03oy54WZDGfJ0Hw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi everyone,
I want ot seek your help identifying the expected behaviour in the scenario
when we hit `*systemctl reboot*` command. When we run above mentioned
command, PostgreSQL immediately closes the connections and shuts
down without following the order mentioned in the service unit file. Since
PostgreSQL is not waiting
for dependent services to shut down first, services are crashing if they
are trying to access PostgreSQL at that time. I further debugged it in the
system journal file and found that systemd logs out the control group user
of postgres immediately. I have these two questions around it.

1. Why does PostgreSQL not wait for other dependent services to stop at the
time of reboot?

2. What is the role of the control group user, and why does systemd log it
out at the time of reboot immediately?

Thanks in advance, and looking forward to hearing from you.

Regards,
Raghvendra

Browse pgsql-bugs by date

  From Date Subject
Next Message Yushu Chen 2025-09-04 09:03:34 Re: BUG #19034: Recursive function with sql_body can replace an existing function but can not be created on it's own
Previous Message zhouenbing 2025-09-04 03:32:18 答复: empty,query_id, pg_stat_activity