diff options
author | Scott Moser <smoser@ubuntu.com> | 2016-05-27 17:03:49 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2016-05-27 17:03:49 -0400 |
commit | b16533714e02fc71d463ca73abee5c9f6237f115 (patch) | |
tree | 259c4c6e5a5fdfa373ad107ba19c764702164598 | |
parent | 653676831e70192d4a0322ee453d6a4c3e6541da (diff) | |
download | vyos-cloud-init-b16533714e02fc71d463ca73abee5c9f6237f115.tar.gz vyos-cloud-init-b16533714e02fc71d463ca73abee5c9f6237f115.zip |
remove blocking udev functionality
This didn't really work. See bug for more info.
LP: #1577844
-rwxr-xr-x | setup.py | 1 | ||||
-rwxr-xr-x | systemd/cloud-init-generator | 3 | ||||
-rw-r--r-- | udev/79-cloud-init-net-wait.rules | 10 | ||||
-rwxr-xr-x | udev/cloud-init-wait | 70 |
4 files changed, 0 insertions, 84 deletions
@@ -184,7 +184,6 @@ else: (USR + '/share/doc/cloud-init/examples/seed', [f for f in glob('doc/examples/seed/*') if is_f(f)]), (LIB + '/udev/rules.d', [f for f in glob('udev/*.rules')]), - (LIB + '/udev', ['udev/cloud-init-wait']), ] # Use a subclass for install that handles # adding on the right init system configuration files diff --git a/systemd/cloud-init-generator b/systemd/cloud-init-generator index ae286d58..2d319695 100755 --- a/systemd/cloud-init-generator +++ b/systemd/cloud-init-generator @@ -107,9 +107,6 @@ main() { "ln $CLOUD_SYSTEM_TARGET $link_path" fi fi - # this touches /run/cloud-init/enabled, which is read by - # udev/cloud-init-wait. If not present, it will exit quickly. - touch "$LOG_D/$ENABLE" elif [ "$result" = "$DISABLE" ]; then if [ -f "$link_path" ]; then if rm -f "$link_path"; then diff --git a/udev/79-cloud-init-net-wait.rules b/udev/79-cloud-init-net-wait.rules deleted file mode 100644 index 8344222a..00000000 --- a/udev/79-cloud-init-net-wait.rules +++ /dev/null @@ -1,10 +0,0 @@ -# cloud-init cold/hot-plug blocking mechanism -# this file blocks further processing of network events -# until cloud-init local has had a chance to read and apply network -SUBSYSTEM!="net", GOTO="cloudinit_naming_end" -ACTION!="add", GOTO="cloudinit_naming_end" - -IMPORT{program}="/lib/udev/cloud-init-wait" - -LABEL="cloudinit_naming_end" -# vi: ts=4 expandtab syntax=udevrules diff --git a/udev/cloud-init-wait b/udev/cloud-init-wait deleted file mode 100755 index b434005d..00000000 --- a/udev/cloud-init-wait +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -CI_NET_READY="/run/cloud-init/network-config-ready" -LOG="/run/cloud-init/${0##*/}.log" -LOG_INIT=0 -MAX_WAIT=60 -DEBUG=0 - -block_until_ready() { - local fname="$1" max="$2" - [ -f "$fname" ] && return 0 - # udevadm settle below will exit at the first of 3 conditions - # 1.) timeout 2.) file exists 3.) all in-flight udev events are processed - # since this is being run from a udev event, the 3 wont happen. - # thus, this is essentially a inotify wait or timeout on a file in /run - # that is created by cloud-init-local. - udevadm settle "--timeout=$max" "--exit-if-exists=$fname" -} - -log() { - [ -n "${LOG}" ] || return - [ "${DEBUG:-0}" = "0" ] && return - - if [ $LOG_INIT = 0 ]; then - if [ -d "${LOG%/*}" ] || mkdir -p "${LOG%/*}"; then - LOG_INIT=1 - else - echo "${0##*/}: WARN: log init to ${LOG%/*}" 1>&2 - return - fi - elif [ "$LOG_INIT" = "-1" ]; then - return - fi - local info="$$ $INTERFACE" - if [ "$DEBUG" -gt 1 ]; then - local up idle - read up idle < /proc/uptime - info="$$ $INTERFACE $up" - fi - echo "[$info]" "$@" >> "$LOG" -} - -main() { - local name="" readyfile="$CI_NET_READY" - local info="INTERFACE=${INTERFACE} ID_NET_NAME=${ID_NET_NAME}" - info="$info ID_NET_NAME_PATH=${ID_NET_NAME_PATH}" - info="$info MAC_ADDRESS=${MAC_ADDRESS}" - log "$info" - - ## Check to see if cloud-init.target is set. If cloud-init is - ## disabled we do not want to do anything. - if [ ! -f "/run/cloud-init/enabled" ]; then - log "cloud-init disabled" - return 0 - fi - - if [ "${INTERFACE#lo}" != "$INTERFACE" ]; then - return 0 - fi - - block_until_ready "$readyfile" "$MAX_WAIT" || - { log "failed waiting for ready on $INTERFACE"; return 1; } - - log "net config ready" -} - -main "$@" -exit - -# vi: ts=4 expandtab |