Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow sops-nix to be restarted when systemd is degraded #626

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

oberon227
Copy link
Contributor

When even a single unit is failed, systemd is-system-running will return degraded. This will prevent sops-nix from being restarted, and will make is seem like sops-nixs under home-manager isn't working.

According to https://www.freedesktop.org/software/systemd/man/latest/systemctl.html#is-system-running, degraded means systemd is in a running state (not starting, or stopping), but that there's one or more failed units.

Inspired by https://github.com/nix-community/home-manager/blob/ffe2d07e771580a005e675108212597e5b367d2d/modules/systemd.nix#L358 I've added degraded as a state in which the activation script will restart sops-nix.

This will help sops-nix under home-manager behave better when there are other, unrelated unit failures on the system.

If Systemd is running, but with even a single failed unit, it'll enter Degraded state.  Restart sops-nix anyway.
@Mic92 Mic92 merged commit 5876a12 into Mic92:master Sep 27, 2024
5 checks passed
@oberon227 oberon227 deleted the improve_service_restarts branch September 27, 2024 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants