From 57840dbffb38d6717130bf446935beff5bb12dfe Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Wed, 8 Aug 2018 00:09:00 +0200 Subject: [PATCH] nixos/cloud-init: order after network-online.target (#44633) Some modules of cloud-init can cope with a network not immediately available (notably, the EC2 module), but some others won't retry if network is not available (notably, the Cloudstack module). network.target doesn't give much guarantee about the network availability. Applications not able to start without a fully configured network should be ordered after network-online.target. Also see #44573 and #44524. --- nixos/modules/services/system/cloud-init.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/nixos/modules/services/system/cloud-init.nix b/nixos/modules/services/system/cloud-init.nix index d513e44dcfb..1a700828ce7 100644 --- a/nixos/modules/services/system/cloud-init.nix +++ b/nixos/modules/services/system/cloud-init.nix @@ -104,8 +104,9 @@ in systemd.services.cloud-init = { description = "Initial cloud-init job (metadata service crawler)"; wantedBy = [ "multi-user.target" ]; - wants = [ "local-fs.target" "cloud-init-local.service" "sshd.service" "sshd-keygen.service" ]; - after = [ "local-fs.target" "network.target" "cloud-init-local.service" ]; + wants = [ "local-fs.target" "network-online.target" "cloud-init-local.service" + "sshd.service" "sshd-keygen.service" ]; + after = [ "local-fs.target" "network-online.target" "cloud-init-local.service" ]; before = [ "sshd.service" "sshd-keygen.service" ]; requires = [ "network.target "]; path = path; @@ -121,8 +122,8 @@ in systemd.services.cloud-config = { description = "Apply the settings specified in cloud-config"; wantedBy = [ "multi-user.target" ]; - wants = [ "network.target" ]; - after = [ "network.target" "syslog.target" "cloud-config.target" ]; + wants = [ "network-online.target" ]; + after = [ "network-online.target" "syslog.target" "cloud-config.target" ]; path = path; serviceConfig = @@ -137,8 +138,8 @@ in systemd.services.cloud-final = { description = "Execute cloud user/final scripts"; wantedBy = [ "multi-user.target" ]; - wants = [ "network.target" ]; - after = [ "network.target" "syslog.target" "cloud-config.service" "rc-local.service" ]; + wants = [ "network-online.target" ]; + after = [ "network-online.target" "syslog.target" "cloud-config.service" "rc-local.service" ]; requires = [ "cloud-config.target" ]; path = path; serviceConfig =