-
-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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/dhcpcd: optimize exitHook #209506
nixos/dhcpcd: optimize exitHook #209506
Conversation
bb6a11a
to
ab11e27
Compare
ab11e27
to
6fabcf9
Compare
6fabcf9
to
18a8021
Compare
7f0f720
to
f911229
Compare
Uhm, apparently it's a syntax error having an empty then clause:
The easy way out is to put a noop |
An alternative could be something like this: let daemons = with config.services;
lib.optional chrony.enable "chrony"
++ lib.optional ntp.enable "ntpd"
++ lib.optional openntpd.enable "openntpd";
in
pkgs.writeText "dhcpcd.exit-hook" ''
if [ "$reason" = BOUND -o "$reason" = REBOOT ]; then
# Restart ntpd. We need to restart it to make sure that it will actually do something:
# if ntpd cannot resolve the server hostnames in its config file, then it will never do
# anything ever again ("couldn't resolve ..., giving up on it"), so we silently lose
# time synchronisation. This also applies to openntpd.
for daemon in ${toString daemons}; do
systemctl try-reload-or-restart "$daemon".service
done
fi
${cfg.runHook}
'' |
f911229
to
0ffe178
Compare
Returned a working variant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last two checks are still redundant, but it works now. So, it's fine by me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we went full circle to the redundant checks again. What happened?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know to little about dhcpd and how it interacts with the other services to know if we should merge this or not.
0ffe178
to
1d93e48
Compare
1d93e48
to
37e53b6
Compare
Rebased PR. |
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/1993 |
37e53b6
to
f1ac766
Compare
f1ac766
to
07782a2
Compare
Rebased PR. |
It is possible to include this PR in the 23.05 release? |
07782a2
to
26b722c
Compare
Rebased PR. |
26b722c
to
1293f04
Compare
Description of changes
Small optimize exit hook.
Fixed this message log:
cc @SuperSandro2000 @ncfavier @blitz @flokli
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/
)nixos/doc/manual/md-to-db.sh
to update generated release notes