tinc module: reload instead of restart
remove enableLegacy option since reloading is dependant on /etc/tinc/<netname> existing
This commit is contained in:
parent
8f94e0bc4b
commit
c9f0c17660
@ -17,7 +17,6 @@ let
|
|||||||
in {
|
in {
|
||||||
|
|
||||||
enable = mkEnableOption "krebs.tinc.${netname}" // { default = true; };
|
enable = mkEnableOption "krebs.tinc.${netname}" // { default = true; };
|
||||||
enableLegacy = mkEnableOption "/etc/tinc/${netname}";
|
|
||||||
|
|
||||||
confDir = mkOption {
|
confDir = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
@ -263,9 +262,9 @@ let
|
|||||||
) config.krebs.tinc;
|
) config.krebs.tinc;
|
||||||
|
|
||||||
environment.etc = mapAttrs' (netname: cfg:
|
environment.etc = mapAttrs' (netname: cfg:
|
||||||
nameValuePair "tinc/${netname}" (mkIf cfg.enableLegacy {
|
nameValuePair "tinc/${netname}" {
|
||||||
source = cfg.confDir;
|
source = cfg.confDir;
|
||||||
})
|
}
|
||||||
) config.krebs.tinc;
|
) config.krebs.tinc;
|
||||||
|
|
||||||
systemd.services = mapAttrs (netname: cfg:
|
systemd.services = mapAttrs (netname: cfg:
|
||||||
@ -287,9 +286,12 @@ let
|
|||||||
];
|
];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
path = [ tinc iproute ];
|
path = [ tinc iproute ];
|
||||||
|
reloadIfChanged = true;
|
||||||
|
restartTriggers = [ cfg.confDir ];
|
||||||
serviceConfig = rec {
|
serviceConfig = rec {
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
ExecStart = "${tinc}/sbin/tincd -c ${cfg.confDir} -d 0 -U ${cfg.user.name} -D --pidfile=/var/run/tinc.${SyslogIdentifier}.pid";
|
ExecStart = "${tinc}/sbin/tincd -c /etc/tinc/${netname} -d 0 -U ${cfg.user.name} -D --pidfile=/var/run/tinc.${SyslogIdentifier}.pid";
|
||||||
|
ExecReload = "${tinc}/sbin/tinc -n ${netname} reload";
|
||||||
SyslogIdentifier = netname;
|
SyslogIdentifier = netname;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user