X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fscripts%2Flnet.in;fp=lustre%2Fscripts%2Flnet;h=afd7519bc7d2d30f2c5383bac43e1266b03952f6;hp=43ad5bf74316aa658f5a68cf68f084563d5a9c3c;hb=25ee73e7733214f7a46f81b2540b7fca67b0eef1;hpb=c6e5f4069edaecb8461df2d03566bd5e333b8a5c diff --git a/lustre/scripts/lnet b/lustre/scripts/lnet.in similarity index 73% rename from lustre/scripts/lnet rename to lustre/scripts/lnet.in index 43ad5bf..afd7519 100644 --- a/lustre/scripts/lnet +++ b/lustre/scripts/lnet.in @@ -95,44 +95,23 @@ status () eval $old_nullglob } -LUSTRE_ROUTES_CONFIG_FILE="/etc/lnet_routes.conf" -LUSTRE_LNET_CONFIG_FILE="/etc/sysconfig/lnet.conf" -LUSTRE_LNET_CONFIG_UTILITY="/usr/sbin/lnetctl" - # See how we were called. case "$1" in start) run_preexec_check "start" touch /var/lock/subsys/lnet modprobe lnet || 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 - lustre_routes_config $2 - elif [ -f "$LUSTRE_ROUTES_CONFIG_FILE" ]; then - lustre_routes_config $LUSTRE_ROUTES_CONFIG_FILE - fi + @BUILD_DLC_TRUE@lnetctl lnet configure || exit 1 + @BUILD_DLC_TRUE@lnetctl import < "@sysconfdir@/lnet.conf" + @BUILD_DLC_FALSE@lctl network up || exit 1 + @BUILD_DLC_FALSE@lustre_routes_config "@sysconfdir@/lnet_routes.conf" run_postexec_check "start" ;; stop) run_preexec_check "stop" lustre_rmmod ptlrpc || exit 1 - lctl network down || exit 1 + @BUILD_DLC_TRUE@lnetctl lnet unconfigure || exit 1 + @BUILD_DLC_FALSE@lctl network down || exit 1 lustre_rmmod libcfs ldiskfs || exit 1 rm -f /var/lock/subsys/lnet run_postexec_check "stop"