From 38b8a270071da7c8dda6a716f75968abdd7d6531 Mon Sep 17 00:00:00 2001 From: Alex Crawford Date: Mon, 12 Sep 2016 16:33:03 -0700 Subject: [PATCH] units: add timeout to all services Since coreos-cloudinit's internal service scheduling is opaque to systemd and doesn't handle dependency-loop detection, it is possible for it to cause deadlocks. Introducing the timeout to all invocations provides a mechanism for system to regain control of the startup sequence. --- units/system-cloudinit@.service | 1 + units/user-cloudinit-proc-cmdline.service | 1 + units/user-cloudinit@.service | 1 + units/user-config-ovfenv.service | 1 + units/user-configdrive.service | 1 + units/user-configvirtfs.service | 1 + 6 files changed, 6 insertions(+) diff --git a/units/system-cloudinit@.service b/units/system-cloudinit@.service index 47882728..40baff35 100644 --- a/units/system-cloudinit@.service +++ b/units/system-cloudinit@.service @@ -7,5 +7,6 @@ ConditionFileNotEmpty=%f [Service] Type=oneshot +TimeoutSec=10min RemainAfterExit=yes ExecStart=/usr/bin/coreos-cloudinit --from-file=%f diff --git a/units/user-cloudinit-proc-cmdline.service b/units/user-cloudinit-proc-cmdline.service index cf1569f7..89342605 100644 --- a/units/user-cloudinit-proc-cmdline.service +++ b/units/user-cloudinit-proc-cmdline.service @@ -8,6 +8,7 @@ ConditionKernelCommandLine=cloud-config-url [Service] Type=oneshot +TimeoutSec=10min RemainAfterExit=yes EnvironmentFile=-/etc/environment ExecStart=/usr/bin/coreos-cloudinit --from-proc-cmdline diff --git a/units/user-cloudinit@.service b/units/user-cloudinit@.service index 0c1b556c..a79c723a 100644 --- a/units/user-cloudinit@.service +++ b/units/user-cloudinit@.service @@ -8,6 +8,7 @@ ConditionFileNotEmpty=%f [Service] Type=oneshot +TimeoutSec=10min RemainAfterExit=yes EnvironmentFile=-/etc/environment ExecStart=/usr/bin/coreos-cloudinit --from-file=%f diff --git a/units/user-config-ovfenv.service b/units/user-config-ovfenv.service index 7a996d5f..9c81ba1b 100644 --- a/units/user-config-ovfenv.service +++ b/units/user-config-ovfenv.service @@ -7,6 +7,7 @@ After=user-config-vmw-tools.service [Service] Type=oneshot +TimeoutSec=10min RemainAfterExit=yes EnvironmentFile=-/etc/environment ExecStart=/usr/bin/coreos-cloudinit --from-vmware-ovf-env=/media/ovfenv/ovf-env.xml diff --git a/units/user-configdrive.service b/units/user-configdrive.service index e24b6d30..b737bdd3 100644 --- a/units/user-configdrive.service +++ b/units/user-configdrive.service @@ -17,6 +17,7 @@ After=oem-cloudinit.service [Service] Type=oneshot +TimeoutSec=10min RemainAfterExit=yes EnvironmentFile=-/etc/environment ExecStart=/usr/bin/coreos-cloudinit --from-configdrive=/media/configdrive diff --git a/units/user-configvirtfs.service b/units/user-configvirtfs.service index c9839ad8..9b1ecd40 100644 --- a/units/user-configvirtfs.service +++ b/units/user-configvirtfs.service @@ -6,6 +6,7 @@ Before=user-config.target [Service] Type=oneshot +TimeoutSec=10min RemainAfterExit=yes EnvironmentFile=-/etc/environment ExecStart=/usr/bin/coreos-cloudinit --from-configdrive=/media/configvirtfs