LinuxCommandLibrary

systemctl-daemon-reexec

Re-execute systemd daemon to apply updates

TLDR

Reexecute systemd

$ systemctl daemon-reexec
copy

SYNOPSIS

systemctl [OPTIONS] daemon-reexec

PARAMETERS

None
    The daemon-reexec verb itself does not accept any specific parameters or arguments beyond the command name. Global systemctl options (e.g., --system, --user) can precede the verb, but they affect the invocation of systemctl generally, not the daemon-reexec operation specifically.

DESCRIPTION

systemctl daemon-reexec instructs the running systemd manager process (typically PID 1 for the system manager or a user instance for the user manager) to re-execute itself. This means the systemd process will effectively restart using its current binary on disk, or a newly installed binary if an update has occurred. The primary use case for this command is after systemd itself has been upgraded to a newer version. Instead of requiring a full system reboot to run the updated systemd code, daemon-reexec allows the new systemd binary to take over without disrupting the running services more than necessary.

It attempts to preserve the manager's runtime state and inherited file descriptors, minimizing the impact on active processes and open sockets. This command is crucial for maintaining system uptime while applying core system updates. It differs significantly from systemctl daemon-reload, which only reloads unit file configurations without replacing the systemd binary itself.

CAVEATS

1. Requires root privileges for the system-wide manager (PID 1).
2. While designed to be as seamless as possible, there might be a momentary disruption or brief pause in manager operations.
3. This command should only be used when systemd itself has been updated or when explicitly recommended by documentation. It is not for routine configuration changes.
4. Always review system logs (journalctl) after execution to confirm successful re-execution and identify any potential issues.

USAGE CONTEXT

Use systemctl daemon-reexec specifically when the systemd package itself has been updated on your system. This allows the new systemd binary to take effect. Do not confuse it with systemctl daemon-reload, which is used after modifying service unit files or other configuration files that systemd reads, but does not replace the running systemd binary.

IMPACT ON SERVICES

A key aspect of daemon-reexec is its attempt to maintain continuity. Unlike a full system reboot, which stops and restarts all services, daemon-reexec tries to preserve the state of currently running services. It achieves this by passing file descriptors and other relevant state information to the newly re-executed systemd process, minimizing service interruption. Services are generally not restarted by this command.

HISTORY

systemd was initiated by Lennart Poettering and Kay Sievers, aiming to replace the traditional SysVinit and Upstart systems. The daemon-reexec functionality was an integral part of systemd's design from its early stages, emphasizing its capability to handle self-updates without requiring a full system reboot. This feature is a cornerstone of systemd's approach to modern Linux system management, offering greater uptime and flexibility compared to older init systems that typically necessitated a reboot after core init system updates.

SEE ALSO

systemctl(1), systemctl daemon-reload(1), systemd(1), journalctl(1)

Copied to clipboard