From d462f1fa2dffd50157633708a483bdd6eb2229f2 Mon Sep 17 00:00:00 2001 From: Roopa Prabhu Date: Sat, 3 Jan 2015 00:27:35 -0800 Subject: [PATCH] Document ifreload new option + add it into init.d networking script Ticket: Reviewed By: trivial Testing Done: Tested build/install/boot + ifupdown2 sanity --- init.d/networking | 11 ++++++++++- man.rst/ifreload.8.rst | 15 ++++++++++++++- sbin/ifupdown | 3 +++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/init.d/networking b/init.d/networking index f0cd2c8..6e5e070 100644 --- a/init.d/networking +++ b/init.d/networking @@ -166,12 +166,21 @@ reload) log_action_end_msg $? ;; +reload-currently-up) + + ifupdown_init + log_action_begin_msg "Reloading currently up network interfaces configuration" + + ifreload --currently-up $EXTRA_ARGS + log_action_end_msg $? + ;; + force-reload) ifupdown_init log_action_begin_msg "Reloading network interfaces configuration" - ifreload -a + ifreload -f -a $EXTRA_ARGS log_action_end_msg $? ;; diff --git a/man.rst/ifreload.8.rst b/man.rst/ifreload.8.rst index eb833be..397a662 100644 --- a/man.rst/ifreload.8.rst +++ b/man.rst/ifreload.8.rst @@ -14,7 +14,7 @@ reload network interface configuration SYNOPSIS ======== - ifreload [-h] -a [-v] [-d] [-f] [-n] + ifreload [-h] (-a|-c) [-v] [-d] [-f] [-n] DESCRIPTION =========== @@ -27,6 +27,10 @@ DESCRIPTION but it skips **ifdown** for interfaces that did not change in the config file. + If you do not wish to execute **down** on any interfaces, but only **up** on + interfaces that were already **up**, please see the **--currently-up** + option below. + OPTIONS ======= @@ -40,6 +44,11 @@ OPTIONS -f, --force force run all operations + -c, --currently-up only reload auto and other interfaces that are + currently up. This can be used as a non-disruptive + alternative to -a because it will not down any + interfaces + EXAMPLES ======== # reload all auto interfaces in **interfaces(5)** file @@ -50,6 +59,10 @@ EXAMPLES **service networking reload** + # reload all currently up interfaces without bringing any interfaces down + + **service networking reload-currently-up** + SEE ALSO ======== ifup(8), diff --git a/sbin/ifupdown b/sbin/ifupdown index 7041f34..d6bdeb2 100755 --- a/sbin/ifupdown +++ b/sbin/ifupdown @@ -353,6 +353,9 @@ def update_ifreload_argparser(argparser): argparser.add_argument('-l', '--syslog', dest='syslog', action='store_true', help=argparse.SUPPRESS) + argparser.add_argument('-f', '--force', dest='force', + action='store_true', + help='force run all operations') def parse_args(argsv, op): if op == 'query':