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

nixos/atop: Fix regression in enabling atop units #240774

Merged

Conversation

tollb
Copy link
Contributor

@tollb tollb commented Jun 30, 2023

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):

$ nix-build '<nixpkgs>' -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/c7e4b0832c92b56db5916811083d2c6963e0bb2d.tar.gz -A nixosTests.atop.defaults

20230708 -- updated test URL for latest commit:

$ nix-build '<nixpkgs>' -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/8f4f1ce005ceba182805d5a8866e39269b9a23a5.tar.gz -A nixosTests.atop.defaults

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
  • 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.11 Release Notes (or backporting 23.05 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
  • 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 Jun 30, 2023
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Jun 30, 2023
@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/2402

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.
@tollb tollb force-pushed the w20230630c_fix_atop_systemd_units branch from c7e4b08 to 8f4f1ce Compare July 8, 2023 13:16
@tollb tollb requested a review from SuperSandro2000 July 8, 2023 14:17
@SuperSandro2000 SuperSandro2000 merged commit aa90c57 into NixOS:master Jul 17, 2023
@tollb tollb deleted the w20230630c_fix_atop_systemd_units branch July 25, 2023 11:31
@pschyska
Copy link
Contributor

Thanks for this @tollb .
I finally got around testing it by removing my local fixes, and it seems to work fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants