nixos/acme: Add proper nginx/httpd config reload checks

Testing of certs failed randomly when the web server was still
returning old certs even after the reload was "complete". This was
because the reload commands send process signals and do not wait
for the worker processes to restart. This commit adds log watchers
which wait for the worker processes to be restarted.
This commit is contained in:
Lucas Savva
2020-08-30 18:38:30 +01:00
parent 982c5a1f0e
commit 61dbf4bf89
2 changed files with 32 additions and 8 deletions

View File

@@ -795,7 +795,7 @@ in
Type = "oneshot";
TimeoutSec = 60;
ExecCondition = "/run/current-system/systemd/bin/systemctl -q is-active httpd.service";
ExecStartPre = "${pkg}/bin/apachectl configtest";
ExecStartPre = "${pkg}/bin/httpd -f ${httpdConf} -t";
ExecStart = "/run/current-system/systemd/bin/systemctl reload httpd.service";
};
};