Skip to content

services.exim: Fix failing systemd service ExecStartPre script#437138

Merged
bjornfor merged 1 commit intoNixOS:masterfrom
michaelfranzl:fix-service-exim
Aug 28, 2025
Merged

services.exim: Fix failing systemd service ExecStartPre script#437138
bjornfor merged 1 commit intoNixOS:masterfrom
michaelfranzl:fix-service-exim

Conversation

@michaelfranzl
Copy link
Copy Markdown
Contributor

The previous script ran unprivileged by default (because the default value of cfg.user was "exim"), and enabling the exim service always failed. It also would have created the directory with unspecified permissions.

The new mechanism uses coreutil's install tool to create the directory on systemd service start, with proper ownership and restrictive permissions.

Fixes #385522

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

The previous script ran unprivileged by default (because the default
value of cfg.user was "exim"), and enabling the exim service always
failed. It also would have created the directory with unspecified permissions.

The new mechanism uses coreutil's install tool to create the
directory on systemd service start, with proper ownership and
restrictive permissions.

Fixes NixOS#385522
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 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/` 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Aug 26, 2025
Copy link
Copy Markdown
Contributor

@4z3 4z3 left a comment

Choose a reason for hiding this comment

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

LGTM

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. and removed 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Aug 27, 2025
Copy link
Copy Markdown
Contributor

@bjornfor bjornfor left a comment

Choose a reason for hiding this comment

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

LGTM.

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Aug 27, 2025
@bjornfor bjornfor merged commit 593cac9 into NixOS:master Aug 28, 2025
36 of 38 checks passed
@michaelfranzl michaelfranzl deleted the fix-service-exim branch August 28, 2025 18:49
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 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

exim: error while starting the service: cannot create directory ‘/var/spool/exim’: Permission denied

3 participants