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

Use upstream units for mdadm #65376

Merged
merged 9 commits into from Aug 3, 2019

Conversation

@abbradar
Copy link
Member

commented Jul 25, 2019

Motivation for this change

Fix RAID1 rebuild on each reboot.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

[WIP] because I still need to test it better. I don't have good ideas for automated testing for now.

@abbradar

This comment has been minimized.

Copy link
Member Author

commented Jul 25, 2019

@GrahamcOfBorg build mdadm

@edolstra
Copy link
Member

left a comment

Looks good, though I'm not sure if we need a separate systemd.shutdownPackages option. We could also just use any shutdown programs in systemd.packages.

pkgs/os-specific/linux/systemd/default.nix Outdated Show resolved Hide resolved
@abbradar

This comment has been minimized.

Copy link
Member Author

commented Jul 25, 2019

@edolstra I think so too but we already have systemd.generatorPackages. I'm all for merging them all, what do you think?

@abbradar

This comment has been minimized.

Copy link
Member Author

commented Jul 25, 2019

Tested on Intel MSM array, before the patch a reboot was practically guaranteed to start a resync. After the patch and four reboots no more resyncs. I think this is ready.

@abbradar abbradar force-pushed the abbradar:mdadm-upstream branch from 088d36c to 22d5cd9 Jul 26, 2019

@ofborg ofborg bot requested a review from edolstra Jul 26, 2019

@abbradar abbradar force-pushed the abbradar:mdadm-upstream branch from 0ceecfd to 0d0d9b0 Jul 26, 2019

@abbradar

This comment has been minimized.

Copy link
Member Author

commented Jul 26, 2019

This is ready with some cosmetic changes. I also removed generator-packages completely after thinking more, we should indeed just use systemd.packages everywhere.

@abbradar abbradar changed the title [WIP] Use upstream units for mdadm Use upstream units for mdadm Jul 26, 2019

@abbradar abbradar changed the base branch from master to staging Jul 26, 2019

@abbradar abbradar force-pushed the abbradar:mdadm-upstream branch from 0d0d9b0 to 81b8efb Jul 26, 2019

abbradar added 4 commits Jul 25, 2019
systemd service: add support for shutdown packages
Shutdown hooks are executed right before the shutdown, which is useful
for some applications. Among other things this is needed for mdadm hook
to run.
mdadm: use absolute paths
We also correct paths in udev rules. This is cleaner and allows for less
unexpected behaviour. We still check for self-references, however we do
it manually now and only for binaries as udev rules can have them.
Rather, we patch them out during initrd generation now.
stage-1 initrd: replace absolute paths for mdadm
We don't patch basename and readlink now too as they were added for
mdadm in 8ecd3a5.
abbradar added 5 commits Jul 25, 2019
swraid service: use upstream units
This fixes a serious bug on NixOS with swraid where mdadm arrays weren't
properly stopped on shutdown. Rather than fixing the unit by adding
`Before=final.target` we completely move to upstream units, which uses
systemd shutdown hooks instead. This also drives down maintenance costs
for us.
systemd service: remove generator-packages option
Use systemd.packages instead, it's less error prone and more in line with
what's expected.

@abbradar abbradar force-pushed the abbradar:mdadm-upstream branch from 81b8efb to 717b8b3 Jul 31, 2019

@abbradar

This comment has been minimized.

Copy link
Member Author

commented Jul 31, 2019

@Mic92 All fixed, thanks!

@GrahamcOfBorg build systemd mdadm

@FRidh FRidh merged commit 7560e2d into NixOS:staging Aug 3, 2019

15 of 16 checks passed

mdadm, systemd on x86_64-darwin No attempt
Details
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A darwin-tested
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release-combined.nix -A tested
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A manual
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A options
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A manual
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A tarball
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A unstable
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
mdadm, systemd on aarch64-linux Success
Details
mdadm, systemd on x86_64-linux Success
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.