systemd / systemd/systemd

systemctl --failed does not show failed units if unit has Restart=on-failure option

Open
#7,107 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

RFE 🎁 systemctl
Dominant language
C
Stars
16.7k
Forks
4.7k
Avg merge
1d 6h
Merged PRs (30d)
140

Description

Submission type
  • Bug report
systemd version the issue has been seen with

systemd 235.0-1

Used distribution

ArchLinux

In case of bug report: Expected behaviour you didn't see

systemctl --failed should show failed units but it does not if unit has Restart=on-failure

In case of bug report: Steps to reproduce the problem
# cat /etc/systemd/system/qwe.service 
[Unit]
Description=qwe

[Service]
Type=simple
ExecStart=/usr/bin/false
RestartSec=30
Restart=on-failure

[Install]
WantedBy=multi-user.target
  1. systemctl enable --now qwe.service

  2. systemctl --failed
    Does not show qwe.service as failed

  3. Comment out 2 Restart* lines

  4. systemctl --system daemon-reload ; systemctl restart qwe

  5. systemctl --failed
    Shows qwe.service as failed

I expected that systemctl --failed will show all units with problems independently on Restart options.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Reproduce the qwe.service unit with Restart=on-failure, then trace how systemctl --failed determines which units to display; done when the command lists that failed unit while restart is configured and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.