nixos/atop: Fix regression in enabling atop units #240774
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix regression where the systemd units for atop are no longer automatically started at boot when programs.atop.enable = true.
Regression was introduced in commit: 09350ff
nixos/atop: Convert log format to fix service start
This commit restructures the atop systemd service config so that the code to convert the log format gets configured as a preStart script along with the addition of the wantedBy rule.
Additional notes on the regression:
The atop unit files get created correctly, but are not linked from
/etc/systemd/system/multi-user.target.wants.
With the module's default settings, the two units that are not started
are: atop.service and atopacct.service. As a result, atop logs do not
get created under /var/log/atop, unless the units are started manually.
The associated PR: #175558
The problem with the units not starting is noted in a comment, along
with a workaround, on PR: #175558 (comment)
Additional notes on testing:
To test, I ran the atop.defaults test (which had been failing on master):
20230708 -- updated test URL for latest commit:
I also successfully built nixosTests.atop.netatop, which had also been failing.
I also built nixosTests.atop.justThePackage and nixosTests.atop.minimal, which had not been failing.
I skipped testing of nixosTests.atop.atopgpu and nixosTests.atop.everything.
NOTE: I believe the update can be backported to NixOS 23.05.
@pschyska @7c6f434c @klemensn
Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)