treewide: depend on shutdown.target if DefaultDependencies=no in almost every case#271326
treewide: depend on shutdown.target if DefaultDependencies=no in almost every case#271326nikstur merged 18 commits intoNixOS:masterfrom
shutdown.target if DefaultDependencies=no in almost every case#271326Conversation
This looks like it's got a few other idiosyncrasies, but I'll leave it alone for now.
Also, mark this service as `oneshot`, since it is.
Also, mark the service as `oneshot` since it is.
| conflicts = [ "shutdown.target" ]; | ||
| unitConfig.DefaultDependencies = false; | ||
| serviceConfig.ExecStart = ''${pkgs.nettools}/bin/domainname "${cfg.domain}"''; | ||
| serviceConfig.Type = "oneshot"; |
There was a problem hiding this comment.
While we're at it, we should probably also add RemainAfterExit
There was a problem hiding this comment.
Only if it makes sense. I don't really know anything about this service. Should it be considered present from the completion of this service? Like, is there a reason to consider it running, or is there a stop procedure when the system shuts down?
There was a problem hiding this comment.
domainname sets the NIS domain name. It's fundamentally a call to setdomainname(2).
I don't think it should RemainAfterExit=yes since it really is just a one-shot configuration. Could be wrong though.
There was a problem hiding this comment.
I think the question is, does it make sense to start it multiple times during a boot cycle? If it doesn't, then it should RemainAfterExit imo. Since in my understanding domainname is idempotent, it should RemainAfterExit.
There was a problem hiding this comment.
does it make sense to start it multiple times during a boot cycle? If it doesn't, then it should RemainAfterExit imo.
What? No, that's not what that's for. RemainAfterExit is there so that things like ExecStop can have meaning for oneshot logic (and also so that dependent units can have BindsTo mean something). If we need a way to designate oneshots that shouldn't be started again by switch-to-configuration, we should make another custom X- thing like X-NoStartOnSwitch or something.
shutdown.target if DefaultDependencies=no in almost every caseshutdown.target if DefaultDependencies=no in almost every case
|
ping @nikstur @ElvishJerricco :-) |
nikstur
left a comment
There was a problem hiding this comment.
Sorry for the delay. I thinks this is good to go.
|
This broke evaluation of the lxdVirtualMachine image jobs. https://hydra.nixos.org/job/nixos/trunk-combined/nixos.lxdVirtualMachineImage.aarch64-linux |
|
@mweinelt would you like me to prepare a patch, or are you on it? |
|
Feel free to come up with a patch. |
Description of changes
Made almost all systemd service units throughout the NixOS tree that specify DefaultDependencies=no conflict with with and come before shutdown.target.
@ElvishJerricco:
shutdown.target
The few exceptions:
Related
@nikstur's work on #267982.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)