onion-chef: set RemainAfterExit, fix tor dependency
This better fits the semantics of this unit and allows for easier automated testing whether the service is active. wantedBy = bindsTo = after = tor.service is the simplest way to ensure that this unit is always running/restarted in lockstep with tor. Previously, onion-chef would have stayed inactive in the case that tor was stopped and then later restarted.
This commit is contained in:
parent
2b9b3ba1c5
commit
60c732a6a1
|
@ -70,14 +70,13 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
systemd.services.onion-chef = {
|
||||
description = "Run onion-chef";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
requires = [ "tor.service" ];
|
||||
partOf = [ "tor.service" ];
|
||||
wantedBy = [ "tor.service" ];
|
||||
bindsTo = [ "tor.service" ];
|
||||
after = [ "tor.service" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.bash}/bin/bash ${onion-chef-script}";
|
||||
User = "root";
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
} // nix-bitcoin-services.defaultHardening;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user