From 0eb236f4fc3e879d67e056e2551401f4086b7e56 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 6 Sep 2014 10:42:07 +0200 Subject: [PATCH] Only enable auto-enabled zones on hotplug events --- src/udev/network-hotplug | 8 ++++---- src/udev/network-hotplug-serial | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/udev/network-hotplug b/src/udev/network-hotplug index df791d38..7b664a9f 100644 --- a/src/udev/network-hotplug +++ b/src/udev/network-hotplug @@ -90,10 +90,10 @@ case "${ACTION}" in # If not, there is nothing to do. isset zone || exit ${EXIT_OK} - # If the zone is already up, we add the device - # to the zone. - if zone_is_up ${zone}; then - zone_up ${zone} + # If the zone is already up or enabled for auto-start, + # we add the device to the zone. + if zone_is_up "${zone}" || zone_is_enabled "${zone}"; then + zone_up "${zone}" fi ;; diff --git a/src/udev/network-hotplug-serial b/src/udev/network-hotplug-serial index 61337022..1dbe89fd 100644 --- a/src/udev/network-hotplug-serial +++ b/src/udev/network-hotplug-serial @@ -90,7 +90,10 @@ case "${ACTION}" in isset sim_imsi || exit ${EXIT_OK} for zone in $(zones_get_all); do - # XXX Check if the zone is enabled. + # Skip zones that are not enabled for auto-start. + if ! zone_is_enabled "${zone}"; then + continue + fi # Skip unsupported hook types. hook="$(zone_get_hook "${zone}")" -- 2.47.3