LinuxCommandLibrary

systemctl-reset-failed

Clear failed systemd unit states

TLDR

Reset the failed state of all units

$ systemctl reset-failed
copy

Reset the failed state of a specific unit
$ systemctl reset-failed [unit]
copy

Reset multiple units at once
$ systemctl reset-failed [unit_1 unit_2 ...]
copy

SYNOPSIS

systemctl reset-failed [UNIT...]

PARAMETERS

UNIT...
    One or more names of systemd units (e.g., nginx.service, dbus.socket) whose failed state should be cleared. If no UNITs are specified, the command will attempt to reset the 'failed' state for all currently failed units across the system.

DESCRIPTION

The systemctl reset-failed command is a crucial utility within the systemd ecosystem for managing the operational status of units. When a service, socket, mount point, or any other systemd unit encounters an error during startup or operation, systemd marks it with a 'failed' state. This state persists even if you subsequently fix the underlying problem and restart the unit successfully. The primary purpose of reset-failed is to clear this persistent 'failed' status, allowing systemd to accurately reflect the current operational health of your system.

It does not fix the root cause of the failure; rather, it cleans up the administrative state. You would typically use this command after you have successfully resolved the issue that caused the unit to fail and, optionally, restarted it. Executing systemctl reset-failed will remove the 'failed' flag, ensuring that the unit no longer appears in the list generated by systemctl --failed or in the detailed output of systemctl status as 'failed'. This helps in maintaining a clear and accurate overview of your system's health.

CAVEATS

Using reset-failed only clears the status flag; it does not resolve the underlying problem that caused the unit to fail. The unit might immediately fail again if the root cause persists. This command typically requires root privileges (e.g., via sudo) or appropriate Polkit permissions to execute, as it modifies the system's runtime state.

WHEN TO USE

This command is best used after you have successfully identified and fixed the problem preventing a systemd unit from running correctly. After fixing the issue and potentially restarting the service (e.g., with systemctl restart UNIT), use systemctl reset-failed UNIT to clear the lingering 'failed' state and get an accurate status.

PERMISSIONS

Due to its nature of modifying system state, systemctl reset-failed usually requires superuser privileges. Users will typically execute it as sudo systemctl reset-failed or as the root user.

HISTORY

The reset-failed subcommand is an integral part of systemctl, the main command-line interface for controlling and querying the systemd init system. systemd was initially released in 2010 and has since become the default init system for most major Linux distributions, replacing older systems like SysVinit. As systemd evolved to manage system services and other components, commands like reset-failed were developed to provide granular control over unit states, enabling administrators to maintain accurate system status reporting.

SEE ALSO

systemctl(1), systemctl status(1), systemctl --failed(1), systemctl start(1), systemctl restart(1), journalctl(1)

Copied to clipboard