Whamcloud - gitweb
LU-9098 lnet: Move lnet_routes.conf to /etc 58/25358/5
authorGiuseppe Di Natale <dinatale2@llnl.gov>
Thu, 9 Feb 2017 18:09:52 +0000 (10:09 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 9 Mar 2017 06:13:06 +0000 (06:13 +0000)
lustre_routes_config now skips lines which are blank or
have a first non-whitespace character of #. This enables
comments to be placed in /etc/lnet_routes.conf. Also,
provide a sample lnet_routes.conf.

The SysV lnet script now expects lnet_routes to be
in /etc. Updated docs to reflect the new location.

Test-Parameters: trivial
Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Change-Id: Ie2fdc5c870aeb8165fd9896bc91120731db45c8b
Reviewed-on: https://review.whamcloud.com/25358
Tested-by: Jenkins
Reviewed-by: Olaf Faaland-LLNL <faaland1@llnl.gov>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Sonia Sharma <sonia.sharma@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre.spec.in
lustre/conf/Makefile.am
lustre/conf/lnet_routes.conf [new file with mode: 0644]
lustre/doc/lustre_routes_config.8
lustre/scripts/lnet
lustre/scripts/lustre_routes_config

index ef4c45f..4b0ff18 100644 (file)
@@ -393,7 +393,9 @@ echo '%{_sbindir}/wiretest' >>lustre-tests.files
 %{_sysconfdir}/udev/rules.d/99-lustre.rules
 %config(noreplace) %{_sysconfdir}/ldev.conf
 %config(noreplace) %{_sysconfdir}/modprobe.d/ko2iblnd.conf
 %{_sysconfdir}/udev/rules.d/99-lustre.rules
 %config(noreplace) %{_sysconfdir}/ldev.conf
 %config(noreplace) %{_sysconfdir}/modprobe.d/ko2iblnd.conf
-
+%if %{with lustre_utils}
+%config(noreplace) %{_sysconfdir}/lnet_routes.conf
+%endif
 %if %{with lustre_modules}
 
 %if %{with ldiskfs}
 %if %{with lustre_modules}
 
 %if %{with ldiskfs}
index 20e745a..06e5e6c 100644 (file)
 #
 
 EXTRA_DIST = lustre.dtd slapd-lustre.conf lustre2ldif.xsl top.ldif \
 #
 
 EXTRA_DIST = lustre.dtd slapd-lustre.conf lustre2ldif.xsl top.ldif \
-             99-lustre.rules lustre ldev.conf ko2iblnd.conf lsvcgss
+             99-lustre.rules lustre ldev.conf ko2iblnd.conf lsvcgss \
+             lnet_routes.conf
 ldapconfdir = $(sysconfdir)/openldap
 
 ldapconfdir = $(sysconfdir)/openldap
 
+sysconf_DATA = ldev.conf
+
 if UTILS
 noinst_SCRIPTS = slapd-lustre.conf
 noinst_DATA = top.ldif lustre2ldif.xsl
 if UTILS
 noinst_SCRIPTS = slapd-lustre.conf
 noinst_DATA = top.ldif lustre2ldif.xsl
+sysconf_DATA += lnet_routes.conf
 endif
 
 udevrulesdir = $(sysconfdir)/udev/rules.d
 endif
 
 udevrulesdir = $(sysconfdir)/udev/rules.d
@@ -53,5 +57,3 @@ endif
 
 modprobedir = $(sysconfdir)/modprobe.d
 modprobe_DATA = ko2iblnd.conf
 
 modprobedir = $(sysconfdir)/modprobe.d
 modprobe_DATA = ko2iblnd.conf
-
-sysconf_DATA = ldev.conf
diff --git a/lustre/conf/lnet_routes.conf b/lustre/conf/lnet_routes.conf
new file mode 100644 (file)
index 0000000..8513a69
--- /dev/null
@@ -0,0 +1,10 @@
+# lnet_routes.conf - configuration file for lnet routes
+#
+# The routes should be in the following format:
+# <network>: { gateway: <gateway>@<exit network> [hop: <hop>] [priority: <prioirity>] }
+#
+# Examples:
+# tcp1: { gateway: 10.1.1.2@tcp0, priority: 3 }
+# tcp4: { gateway: 10.3.3.4@tcp }
+# tcp6: { gateway: 10.3.3.6@tcp, hop: 2, priority: 5 }
+# tcp7: { gateway: 10.3.3.[6-12]@tcp, priority: 20, hop: 8 }
index bd7eb7b..125ac1e 100644 (file)
@@ -5,7 +5,7 @@ lustre_routes_config \- Configure routes dynamically
 .B "lustre_routes_config"
 .SH DESCRIPTION
 lustre_route_config sets or cleans up LNET routes from the specified config
 .B "lustre_routes_config"
 .SH DESCRIPTION
 lustre_route_config sets or cleans up LNET routes from the specified config
-file.  /etc/sysconfig/lustre_routes.conf file can be used to automatically
+file.  /etc/lnet_routes.conf file can be used to automatically
 configure routes on LNET startup.
 .LP
 The format of the config file is:
 configure routes on LNET startup.
 .LP
 The format of the config file is:
@@ -57,6 +57,6 @@ lustre_routes_config --cleanup <path/to/routes_config_file>
 .BR lctl (8)
 .BR lustre_routes_conversion (8)
 .SH FILES
 .BR lctl (8)
 .BR lustre_routes_conversion (8)
 .SH FILES
-/etc/sysconfig/lustre_routes.conf
+/etc/lnet_routes.conf
 .SH AUTHOR
 Amir Shehata
 .SH AUTHOR
 Amir Shehata
index 10e91c9..01f7e4f 100644 (file)
@@ -95,7 +95,7 @@ status ()
        eval $old_nullglob
 }
 
        eval $old_nullglob
 }
 
-LUSTRE_ROUTES_CONFIG_FILE="/etc/sysconfig/lnet_routes.conf"
+LUSTRE_ROUTES_CONFIG_FILE="/etc/lnet_routes.conf"
 LUSTRE_LNET_CONFIG_FILE="/etc/sysconfig/lnet.conf"
 LUSTRE_LNET_CONFIG_UTILITY="/usr/sbin/lnetctl"
 
 LUSTRE_LNET_CONFIG_FILE="/etc/sysconfig/lnet.conf"
 LUSTRE_LNET_CONFIG_UTILITY="/usr/sbin/lnetctl"
 
index f60ed11..8f31bbf 100755 (executable)
@@ -83,6 +83,12 @@ find_arg_value() {
 }
 
 while read line; do
 }
 
 while read line; do
+       # skip lines that are entirely whitespace or
+       # when the first non-whitespace character is #
+       if [[ "$line" =~ ^[[:space:]]*(#|$) ]]; then
+               continue
+       fi
+
        # Parse line using ':' and ',' as delimiters and ignoring all
        # white space, tabs and linefeed
        IFS="$IFS:,"
        # Parse line using ':' and ',' as delimiters and ignoring all
        # white space, tabs and linefeed
        IFS="$IFS:,"