Hi Vu,

I have a comment in line.

B.R
/Thang

-----Original Message-----
From: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au> 
Sent: Friday, August 9, 2019 9:47 AM
To: anders.wid...@ericsson.com; gary....@dektech.com.au;
thang.d.ngu...@dektech.com.au
Cc: opensaf-devel@lists.sourceforge.net; Vu Minh Nguyen
<vu.m.ngu...@dektech.com.au>
Subject: [PATCH 1/1] scripts: use tipc instead of obsolute tipc-config in
opensaf_reboot [#3066]

---
 scripts/opensaf_reboot          | 11 ++++++++++-
 src/nid/configure_tipc.in       |  1 -
 tools/cluster_sim_uml/build_uml |  4 ++--
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/scripts/opensaf_reboot b/scripts/opensaf_reboot index
9623c39a8..be635a442 100644
--- a/scripts/opensaf_reboot
+++ b/scripts/opensaf_reboot
@@ -128,6 +128,15 @@ temp_node_id=`cat "$NODE_ID_FILE"`  temp_node_id=`echo
"$temp_node_id" |sed -e 's:^0[bBxX]::'| sed -e 's:^:0x:'`
self_node_id=`printf "%d" $temp_node_id`
 
+tipc=$(which tipc 2> /dev/null)
+tipc_config=$(which tipc-config 2> /dev/null)
+
+if [ -x "${tipc}" ]; then
+       tipc_config="${pkglibdir}"/tipc-config
+fi
+
+unset tipc
+
[THANG]: I think no need.
 # If no argument is provided, forcing node reboot immediately without log
# flushing, process terminating, disk un-mounting.
 # If clm cluster reboot requested argument one and two are set but not
used, @@ -149,7 +158,7 @@ else
 
                 # Isolate the node
                 if [ "$MDS_TRANSPORT" = "TIPC" ]; then
-                   tipc-config -bd eth:$TIPC_ETH_IF
+                   ${tipc_config} -bd=eth:$TIPC_ETH_IF
[THANG]: Can add like this ?
-----------------------------------------------------------------------
+               tipc=$(which tipc 2> /dev/null)
+               if [ -x "${tipc}" ]; then
+                       tipc bearer disable media eth device $TIPC_ETH_IF
+               else
+                       tipc-config -bd eth:$TIPC_ETH_IF
+               fi
-----------------------------------------------------------------------
                 else
                    $icmd pkill -STOP osafdtmd
                 fi
diff --git a/src/nid/configure_tipc.in b/src/nid/configure_tipc.in index
b13a685f3..73dd1cbe0 100644
--- a/src/nid/configure_tipc.in
+++ b/src/nid/configure_tipc.in
@@ -69,7 +69,6 @@ if [ "$#" -lt "1" ] || [ "$#" -gt "4" ]
      exit 1
 fi
 
-# Make sure tipc-config is available, either in path or in default location
tipc=$(which tipc 2> /dev/null)  tipc_config=$(which tipc-config 2>
/dev/null)
 
diff --git a/tools/cluster_sim_uml/build_uml
b/tools/cluster_sim_uml/build_uml index 8e48bb5a5..edbe01c5d 100755
--- a/tools/cluster_sim_uml/build_uml
+++ b/tools/cluster_sim_uml/build_uml
@@ -225,11 +225,11 @@ cmd_create_rootfs()
 
     install -m 755 $archive/scripts/*.rc etc/init.d
     cp $scripts/profile etc
-    cp $scripts/reboot $scripts/shutdown $opensaf_home/scripts/tipc-config
usr/sbin
+    cp $scripts/reboot $scripts/shutdown usr/sbin
     mkdir -p root/www/cgi-bin
     cp $scripts/rshd root/www/cgi-bin
     cp $scripts/rsh $scripts/rcp $scripts/sudo usr/bin
-    chmod +x usr/sbin/shutdown usr/sbin/tipc-config root/www/cgi-bin/rshd
usr/bin/rsh usr/bin/rcp usr/bin/sudo
+    chmod +x usr/sbin/shutdown root/www/cgi-bin/rshd usr/bin/rsh 
+ usr/bin/rcp usr/bin/sudo
 
     echo "Copy some needed extra programs (bash, ...)"
     install /bin/bash usr/bin
--
2.17.1




_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to