nixos/alertmanager: start after the network-online target
If the host network stack is slow to start, the alertmanager fails to
start with this error message:
caller=main.go:256 msg="unable to initialize gossip mesh" err="create memberlist: Failed to get final advertise address: No private IP address found, and explicit IP not provided"
This bug can be reproduced by shutting down the network stack and
restarting the alertmanager.
Note I don't know why I didn't hit this issue with previous
alertmanager releases.
This commit is contained in:
@@ -155,7 +155,7 @@ in {
|
|||||||
|
|
||||||
systemd.services.alertmanager = {
|
systemd.services.alertmanager = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
after = [ "network.target" ];
|
after = [ "network-online.target" ];
|
||||||
preStart = ''
|
preStart = ''
|
||||||
${lib.getBin pkgs.envsubst}/bin/envsubst -o "/tmp/alert-manager-substituted.yaml" \
|
${lib.getBin pkgs.envsubst}/bin/envsubst -o "/tmp/alert-manager-substituted.yaml" \
|
||||||
-i "${alertmanagerYml}"
|
-i "${alertmanagerYml}"
|
||||||
|
|||||||
Reference in New Issue
Block a user