cluster/services/ways: only reload nginx if actually running
This commit is contained in:
parent
05b584c748
commit
d16dd6de7b
1 changed files with 5 additions and 5 deletions
|
@ -89,11 +89,11 @@ in
|
|||
'') consulServiceWays;
|
||||
in pkgs.writeText "ways-upstreams.ctmpl" (lib.concatStringsSep "\n" (lib.unique upstreams));
|
||||
destination = "/run/consul-template/nginx-ways-upstreams.conf";
|
||||
exec.command = [
|
||||
"${config.services.nginx.package}/bin/nginx"
|
||||
"-s" "reload"
|
||||
"-g" "pid /run/nginx/nginx.pid;"
|
||||
];
|
||||
exec.command = lib.singleton (pkgs.writeShellScript "ways-reload" ''
|
||||
if ${config.systemd.package}/bin/systemctl is-active nginx.service; then
|
||||
exec ${config.services.nginx.package}/bin/nginx -s reload -g 'pid /run/nginx/nginx.pid;'
|
||||
fi
|
||||
'');
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue