nixos/zerotierone: simplify the unit
There is no need to stop/start the unit when the machine is online or offline. This should fix the shutdown locking issues. nixos zerotier: sometimes it doesn't shutdown
This commit is contained in:
parent
71c19d3efa
commit
b54c60b689
@ -38,10 +38,13 @@ in
|
||||
config = mkIf cfg.enable {
|
||||
systemd.services.zerotierone = {
|
||||
description = "ZeroTierOne";
|
||||
path = [ cfg.package ];
|
||||
bindsTo = [ "network-online.target" ];
|
||||
after = [ "network-online.target" ];
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
|
||||
path = [ cfg.package ];
|
||||
|
||||
preStart = ''
|
||||
mkdir -p /var/lib/zerotier-one/networks.d
|
||||
chmod 700 /var/lib/zerotier-one
|
||||
@ -53,6 +56,7 @@ in
|
||||
ExecStart = "${cfg.package}/bin/zerotier-one -p${toString cfg.port}";
|
||||
Restart = "always";
|
||||
KillMode = "process";
|
||||
TimeoutStopSec = 5;
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user