mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 08:23:09 +00:00
OpenVPN: don't fail to restart stopped units (#345993)
This commit is contained in:
commit
a633b5fb12
@ -73,8 +73,9 @@ let
|
||||
openvpn-restart = {
|
||||
wantedBy = [ "sleep.target" ];
|
||||
path = [ pkgs.procps ];
|
||||
script = "pkill --signal SIGHUP --exact openvpn";
|
||||
#SIGHUP makes openvpn process to self-exit and then it got restarted by systemd because of Restart=always
|
||||
script = let
|
||||
unitNames = map (n: "openvpn-${n}.service") (builtins.attrNames cfg.servers);
|
||||
in "systemctl try-restart ${lib.escapeShellArgs unitNames}";
|
||||
description = "Sends a signal to OpenVPN process to trigger a restart after return from sleep";
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user