From 77c920f2d9eb39ee21f12028b28809d44531ea76 Mon Sep 17 00:00:00 2001 From: Roopa Prabhu Date: Tue, 12 May 2015 07:32:53 -0700 Subject: [PATCH] Add new SKIP_DOWN_AT_SYSRESET /etc/init.d/networking config option to skip deconfiguring interfaces Ticket: CM-5900 Reviewed By: CCR-2921 Testing Done: Tested 'service networking stop' during system reboot and shutdown --- config/networking | 6 ++++++ init.d/networking | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/config/networking b/config/networking index 8b0474c..cc3d3ef 100644 --- a/config/networking +++ b/config/networking @@ -15,3 +15,9 @@ SYSLOG="no" # Exclude interfaces EXCLUDE_INTERFACES= + +# Set to 'yes' if you want to skip ifdown during system reboot +# and shutdown. This is of interest in large scale interface +# deployments where you dont want to wait for interface +# deconfiguration to speed up shutdown/reboot +SKIP_DOWN_AT_SYSRESET="yes" diff --git a/init.d/networking b/init.d/networking index 6e5e070..45d3d78 100644 --- a/init.d/networking +++ b/init.d/networking @@ -147,6 +147,18 @@ start) ;; stop) + if [ "$SKIP_DOWN_AT_SYSRESET" = "yes" ]; then + shutdown_or_reboot=$(runlevel 2>/dev/null | \ + /usr/bin/tr -s " " | \ + /usr/bin/cut -d " " \ + -f1- --output-delimiter=$'\n' | \ + /bin/grep -e "0" -e "6") + if [ -n "$shutdown_or_reboot" ]; then + log_action_begin_msg "Deconfiguring network interfaces..skip" + log_action_end_msg 0 + exit 0 + fi + fi ifupdown_init check_network_file_systems check_network_swap