Skip to content

Comments

nixos/openldap: fix systemd rejecting notification#177084

Merged
Ekleog merged 1 commit intomasterfrom
openldap-notifyaccess-all
Jun 13, 2022
Merged

nixos/openldap: fix systemd rejecting notification#177084
Ekleog merged 1 commit intomasterfrom
openldap-notifyaccess-all

Conversation

@Ekleog
Copy link
Member

@Ekleog Ekleog commented Jun 9, 2022

On one of the two machines I have running openldap, openldap failed to start due to a "timeout". Increasing the allowed startup delay didn't help.

I noticed the following in logs:

openldap.service: Got notification message from PID 5224, but reception only permitted for main PID 5223

It turns out that on this machine at least, openldap apparently sends the notification from a non-main process, which means that we need this NotifyAccess setting for systemd to record that it successfully started. Without it, after 30 seconds systemd kills the process because it didn't receive the sd_notify call.

Somehow the other machine I have on nixos running ldap works fine even without this, but I could not figure out what changes the behavior.

Given that AFAIU NotifyAccess still restricts to "from the cgroup of the service", I think this change should be safe.

Things done
  • Tested with my regular config and systemd.services.openldap.serviceConfig.NotifyAccess = "all";
  • Fits CONTRIBUTING.md.

This probably needs a backport to 22.05.

cc @mweinelt for review as you switched to type=notify recently :)

On one of the two machines I have running openldap, openldap failed to start due to a "timeout". Increasing the allowed startup delay didn't help.

I noticed the following in logs:
```
openldap.service: Got notification message from PID 5224, but reception only permitted for main PID 5223
```

It turns out that on this machine at least, openldap apparently sends the notification from a non-main process, which means that we need this NotifyAccess setting for systemd to record that it successfully started. Without it, after 30 seconds systemd kills the process because it didn't receive the sd_notify call.

Somehow the other machine I have on nixos running ldap works fine even without this, but I could not figure out what changes the behavior.

Given that AFAIU NotifyAccess still restricts to "from the cgroup of the service", I think this change should be safe.
@Ekleog Ekleog requested a review from mweinelt June 9, 2022 20:12
@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 9, 2022
@mweinelt mweinelt requested a review from kwohlfahrt June 9, 2022 20:14
@ofborg ofborg bot added 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. labels Jun 9, 2022
@Ma27
Copy link
Member

Ma27 commented Jun 13, 2022

Using this fix for my personal openldap instance since I upgraded it to 22.05 👍

@mweinelt
Copy link
Member

Part of #176449

@github-actions
Copy link
Contributor

Successfully created backport PR #177520 for release-22.05.

@dasJ dasJ deleted the openldap-notifyaccess-all branch June 13, 2022 13:40
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants