From 0abcbacbcf37c8a08afe98c13db9c545d95d16c3 Mon Sep 17 00:00:00 2001 From: yujian Date: Sun, 4 Jun 2006 07:31:39 +0000 Subject: [PATCH] b=9853 Fix a bug - "Device does not exist for Service". --- lustre/scripts/lc_cluman.sh | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/lustre/scripts/lc_cluman.sh b/lustre/scripts/lc_cluman.sh index f16e1ad..d25d65e 100755 --- a/lustre/scripts/lc_cluman.sh +++ b/lustre/scripts/lc_cluman.sh @@ -339,6 +339,13 @@ add_services() { done ${CONFIG_CMD} --service=${TARGET_SRVNAMES[i]} \ + --add_device \ + --name=${TARGET_DEVNAMES[i]} + if ! check_retval $?; then + return 1 + fi + + ${CONFIG_CMD} --service=${TARGET_SRVNAMES[i]} \ --device=${TARGET_DEVNAMES[i]} \ --mount \ --mountpoint=${TARGET_MNTPNTS[i]} \ @@ -359,7 +366,7 @@ gen_cluster_xml() { declare -i i local mcast_IPaddr local node_names - local hbopt_str hbopt + local hbopt [ -e "${CLUMAN_DIR}/cluster.xml" ] && \ /bin/mv ${CLUMAN_DIR}/cluster.xml ${CLUMAN_DIR}/cluster.xml.old @@ -408,18 +415,15 @@ gen_cluster_xml() { fi # Add other tags - if [ -n "${HBOPT_OPT}"]; then - hbopt_str=`echo ${HBOPT_OPT}|awk '{split($HBOPT_OPT, a, ":")}\ - END {for (i in a) print a[i]}'` - idx=0 - for hbopt in ${hbopt_str} + if [ -n "${HBOPT_OPT}" ]; then + while read -r hbopt do ${CONFIG_CMD} ${hbopt} if ! check_retval $?; then return 1 fi - idx=$idx+1 - done + done < <(echo ${HBOPT_OPT}|awk '{split($HBOPT_OPT, a, ":")}\ + END {for (i in a) print a[i]}') fi return 0 @@ -429,9 +433,11 @@ gen_cluster_xml() { # # Create the cluster.xml file and scp it to the each node's /etc/ create_config() { - CONFIG_PRIMNODE=${TMP_DIR}$"/cluster.xml."${PRIM_NODENAME} declare -i idx + /bin/mkdir -p ${TMP_DIR} + CONFIG_PRIMNODE=${TMP_DIR}$"/cluster.xml."${PRIM_NODENAME} + # Create symlinks for Lustre services verbose_output "Creating symlinks for lustre target services in"\ "${PRIM_NODENAME} failover group hosts..." -- 1.8.3.1