Thread

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

    Raghvendra Mishra <raghshr1351@gmail.com> — 2025-09-04T08:59:44Z

    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