Visitar URL original
socket unit stuck forever in `final-sigterm` after `daemon-reload` · Issue #44457 · systemd/systemd · GitHub
Skip to content

socket unit stuck forever in final-sigterm after daemon-reload #44457

Open

Description

@aleivag

systemd version the issue has been seen with

=260.4

Used distribution

centos9/10

Linux kernel version used

6.16.1

CPU architectures issue was seen on

None

Component

systemd

Expected behaviour you didn't see

After TimeoutSec=, the socket unit goes from final-sigterm to final-sigkill and then to failed (timeout), as it does when there's no reload.

Unexpected behaviour you saw

If PID 1 is reloaded while a .socket unit is in final-sigterm and the unit has no control process, the unit stays in deactivating (final-sigterm) forever. Its cgroup is empty and its stop job never finishes. stop, start, daemon-reload and daemon-reexec don't recover it, so only a reboot does.

socket_coldplug() only re-arms the timer when control_pid is set, and socket units have no notify_cgroup_empty handler. After the reload, nothing moves the unit forward. mount.c and swap.c use the same coldplug pattern.

Steps to reproduce the problem

# repro.socket
[Socket]
ListenStream=/run/repro.sock
TimeoutSec=10
ExecStartPost=/bin/sh -c 'setsid sh -c "trap \"sleep 3; exit\" TERM; while :; do sleep 0.2; done" </dev/null >/dev/null 2>&1 &'
systemctl start repro.socket
systemctl stop --no-block repro.socket   # -> final-sigterm, timer armed
systemctl daemon-reload                  # within TimeoutSec
sleep 30
systemctl status repro.socket            # still "deactivating (final-sigterm)", empty cgroup

Without the daemon-reload, the unit goes to failed (timeout) after 10 s as expected.

Additional program output to the terminal or log subsystem illustrating the issue

● repro.socket
     Loaded: loaded (/run/systemd/system/repro.socket; static)
     Active: deactivating (final-sigterm) since Mon 2026-10-26 12:37:36 PDT; 3min 20s ago
        Job: 2318
      Tasks: 0
     CGroup: /system.slice/repro.socket

systemd[1]: Starting repro.socket...
systemd[1]: Listening on repro.socket.
systemd[1]: Stopping repro.socket...

$ cat /sys/fs/cgroup/system.slice/repro.socket/cgroup.events
populated 0


Without the second `daemon-reload`:


systemd[1]: Stopping repro.socket...
systemd[1]: repro.socket: Stopping timed out (2). Killing.
systemd[1]: repro.socket: Failed with result 'timeout'.

Activity

  1. added
    bug 🐛Programming errors, that need preferential fixing
    on Oct 26, 2026
  2. added 6 commits that reference this issue on Oct 27, 2026
    6bfd883
    dfdc1ab
    74578b5
    aa1579d
    5c32f00
    889de5e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Programming errors, that need preferential fixingpid1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions