From: Amir Shehata Date: Fri, 6 Mar 2015 20:17:49 +0000 (-0800) Subject: LU-6340 lnet: LNet startup script fix X-Git-Tag: 2.7.51~44 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=f7259a01bb3f18f571d6ed8ecf7c95e1f9521bbb LU-6340 lnet: LNet startup script fix When starting up LNet via the startup script, check if the default LNet yaml configuration file is present, if it is, then make sure to use "lnetctl lnet configure" to bring up LNet instead of "lctl network up". The latter configures networks and routes defined in the modparams, while the former does not, since the configuration defined in the YAML file will be used. Signed-off-by: Amir Shehata Change-Id: I1a05cba2a9a6b7a2179b541f1ea5db6d2e89b243 Reviewed-on: http://review.whamcloud.com/14000 Reviewed-by: Dmitry Eremin Reviewed-by: Bob Glossman Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/scripts/lnet b/lustre/scripts/lnet index 1a9d467..7bca8e2 100644 --- a/lustre/scripts/lnet +++ b/lustre/scripts/lnet @@ -122,7 +122,21 @@ case "$1" in run_preexec_check "start" touch /var/lock/subsys/lnet modprobe lnet || exit 1 - lctl network up || exit 1 + # if lnet.conf file exists then use lnetctl lnet configure, since + # that doesn't load the networks and routes defined in the mod + # params. The appropriate configuration will be picked up from + # the lnet.conf YAML file. + if [ -x $LUSTRE_LNET_CONFIG_UTILITY -a -f "$LUSTRE_LNET_CONFIG_FILE" ]; then + $LUSTRE_LNET_CONFIG_UTILITY lnet configure || exit 1 + else + lctl network up || exit 1 + fi + # if an lnet.conf file exists then pass that to the lnetctl + # utility for parsing. This will configure the items defined + # in YAML format in the config file. + if [ -x $LUSTRE_LNET_CONFIG_UTILITY -a -f "$LUSTRE_LNET_CONFIG_FILE" ]; then + $LUSTRE_LNET_CONFIG_UTILITY import < $LUSTRE_LNET_CONFIG_FILE + fi # if a routes config file is given then use it to configure the # routes if not then default to LUSTRE_ROUTES_CONFIG_FILE if [ -f "$2" ]; then @@ -130,12 +144,6 @@ case "$1" in elif [ -f "$LUSTRE_ROUTES_CONFIG_FILE" ]; then lustre_routes_config $LUSTRE_ROUTES_CONFIG_FILE fi - # if an lnet.conf file exists then pass that to the lnetctl - # utility for parsing. This will configure the items defined - # in YAML format in the config file. - if [ -f $LUSTRE_LNET_CONFIG_UTILITY ] && [ -f "$LUSTRE_LNET_CONFIG_FILE" ]; then - $LUSTRE_LNET_CONFIG_UTILITY import < $LUSTRE_LNET_CONFIG_FILE - fi run_postexec_check "start" ;; stop)