onion-services: don't propagate restart of onion-addresses to depending services
Currently, public services that publish their onion addresses have a `requires` dependeny on service `onion-addresses`, so they are restarted when `onion-addresses` restarts. This has the downside that most of nix-bitcoin's services are restarted when a new onion service is added and the system config has the following common settings: - nix-bitcoin.onionServices.bitcoind.public = true - nix-bitcoin.operator.enable = true Sequence of events: 1. onion service is added 2. `onion-addresses` restarts, because the new onion service is made available to `operator` 3. bitcoind restarts 4. all depending services restart Fix this by using a `wants` dependency.
This commit is contained in:
parent
55fc77d72f
commit
a3490dfc0f
2 changed files with 6 additions and 1 deletions
|
|
@ -80,7 +80,9 @@ in {
|
|||
systemd.services = let
|
||||
onionAddresses = [ "onion-addresses.service" ];
|
||||
in genAttrs publicServices (service: {
|
||||
requires = onionAddresses;
|
||||
# TODO-EXTERNAL: Instead of `wants`, use a future systemd dependency type
|
||||
# that propagates initial start failures but no restarts
|
||||
wants = onionAddresses;
|
||||
after = onionAddresses;
|
||||
});
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue