Skip to content

Comments

nixos: add service to propagate status of activationScripts#208942

Open
bjornfor wants to merge 1 commit intoNixOS:masterfrom
bjornfor:add-nixos-activation-scripts-service
Open

nixos: add service to propagate status of activationScripts#208942
bjornfor wants to merge 1 commit intoNixOS:masterfrom
bjornfor:add-nixos-activation-scripts-service

Conversation

@bjornfor
Copy link
Contributor

@bjornfor bjornfor commented Jan 3, 2023

Description of changes

This change makes systemctl --failed indicate the result of the NixOS
activation scripts, instead of making their failure only visible if you
(1) manually look at system logs or (2) run the activation script
manually.

I'm re-using the existing /run/nixos directory for the (runtime) state.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Jan 3, 2023
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jan 3, 2023
This change makes `systemctl --failed` indicate the result of the NixOS
activation scripts, instead of making their failure only visible if you
(1) manually look at system logs or (2) run the activation script
manually.

I'm re-using the existing /run/nixos directory for the (runtime) state.
@bjornfor bjornfor force-pushed the add-nixos-activation-scripts-service branch from 1847a9a to f61d7ea Compare January 4, 2023 20:30
@bjornfor bjornfor marked this pull request as ready for review January 4, 2023 20:35
@bjornfor bjornfor requested a review from dasJ as a code owner January 4, 2023 20:35
@bjornfor bjornfor requested a review from Mic92 January 7, 2023 11:51
@bjornfor bjornfor requested a review from infinisil January 17, 2023 16:28
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/1735

Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feels hacky to me. Could we make this more straight forward?

@bjornfor
Copy link
Contributor Author

this feels hacky to me. Could we make this more straight forward?

I'm open to ideas.

I guess when we at some point(?) get systemd in stage-1, we'd implement activationScripts as a systemd service and this won't be needed anymore?

But until then, I really think we should have a way to tell systemd about activationScripts failures, like this PR.

@bjornfor
Copy link
Contributor Author

Ping?

If nobody has anything more to say, I plan to merge in one week.

@infinisil
Copy link
Member

I guess when we at some point(?) get systemd in stage-1, we'd implement activationScripts as a systemd service and this won't be needed anymore?

We have that though! #164943

@bjornfor
Copy link
Contributor Author

bjornfor commented Feb 1, 2023

I guess when we at some point(?) get systemd in stage-1, we'd implement activationScripts as a systemd service and this won't be needed anymore?

We have that though! #164943

Cool! I didn't know that. I'll try to test it.

@wegank wegank added 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 2.status: merge conflict This PR has merge conflicts with the target branch labels Mar 19, 2024
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants