# Keep systemd service children inside the shutdown boundary

> A stopped main process does not necessarily mean every process belonging to the service has exited.

- Canonical URL: https://update.dsesecurity.com/updates/keep-systemd-service-children-inside-the-shutdown-boundary/
- Publisher: Detection Systems & Engineering (DSE Security)
- Author: DSE Security Editorial Team
- Published: 2026-10-20T18:15:27+00:00
- Modified: 2026-10-20T18:34:33+00:00
- Last reviewed by DSE: 2026-10-20
- Resource type: Guide
- DSE priority: Information
- Topics: IT, Networks & Infrastructure
- Reading time: 2 minutes

## What you need to know

A stopped main process does not necessarily mean every process belonging to the service has exited.

## Potentially affected

Review systemd unit process termination using the Debian trixie systemd.kill manual.

## DSE recommendation

DSE recommends inventorying workers and subprocesses created by a service before changing KillMode.

## Article

A stopped main process does not necessarily mean every process belonging to the service has exited.

## Source facts

The Debian systemd.kill manual describes KillMode=control-group as terminating remaining processes in the unit’s control group on stop. The process mode targets only the main process, while none avoids manager-driven termination. The manual warns against process and none because surviving children can escape ordinary lifecycle and resource management while the service appears stopped.

Source: [Debian systemd manual — systemd.kill(5) — systemd — Debian trixie — Debian Manpages](https://manpages.debian.org/trixie/systemd/systemd.kill.5.en.html).

## Applicability

Review systemd unit process termination using the Debian trixie systemd.kill manual.

## DSE recommendation

DSE recommends inventorying workers and subprocesses created by a service before changing KillMode. Define the graceful stop action and the bounded fallback when children do not exit. Avoid weakening the process boundary merely to preserve an unidentified helper. If a child must outlive the parent, give it an explicitly managed lifecycle rather than hiding it in a stopped unit. Keep restart behavior safe against duplicate workers, stale locks, or listeners left by a previous instance.

## Verification

On a disposable service that creates a child process, compare the unit state with its remaining process set after stop. Verify the chosen mode and timeout terminate the intended workload without affecting unrelated units. Repeat startup afterward and confirm there is only one expected set of workers. Retain the main and child process identities with the unit’s effective stop configuration. Ask the service owner to approve the grace period and escalation result, and reconcile every surviving process before marking the stop exercise complete.

## Official reference

[Debian systemd manual — systemd.kill(5) — systemd — Debian trixie — Debian Manpages](https://manpages.debian.org/trixie/systemd/systemd.kill.5.en.html). Reviewed October 20, 2026.

## Primary reference

- Name: Debian systemd manual — systemd.kill(5) — systemd — Debian trixie — Debian Manpages
- Authority: manpages.debian.org
- URL: https://manpages.debian.org/trixie/systemd/systemd.kill.5.en.html
- Source publication date: Not stated by the source

## Citation and use

Preferred citation: “Keep systemd service children inside the shutdown boundary,” DSE Security, https://update.dsesecurity.com/updates/keep-systemd-service-children-inside-the-shutdown-boundary/
Publishing principles: https://update.dsesecurity.com/updates/dse-updates-editorial-methodology/
Usage and citation policy: https://update.dsesecurity.com/usage/
Copyright © 2026 Detection Systems & Engineering. All rights reserved.
