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>
%{_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}
#
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
modprobedir = $(sysconfdir)/modprobe.d
modprobe_DATA = ko2iblnd.conf
modprobedir = $(sysconfdir)/modprobe.d
modprobe_DATA = ko2iblnd.conf
-
-sysconf_DATA = ldev.conf
--- /dev/null
+# 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 }
.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:
.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
-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"
+ # 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:,"