Revision: 7118 http://sourceforge.net/p/ipcop/svn/7118 Author: dotzball Date: 2013-11-10 09:35:48 +0000 (Sun, 10 Nov 2013) Log Message: ----------- Fix "Assembling RAID arrays ... FAIL" on raid installations.
mdadm exits with return code 2 if everything is ok but the raid is already loaded. Now we check for return code 0 or 2 for OK/DONE and anything else is FAIL. Modified Paths: -------------- ipcop/trunk/config/install/init Modified: ipcop/trunk/config/install/init =================================================================== --- ipcop/trunk/config/install/init 2013-11-09 10:36:46 UTC (rev 7117) +++ ipcop/trunk/config/install/init 2013-11-10 09:35:48 UTC (rev 7118) @@ -56,6 +56,17 @@ fi } +test_mdadm_ok() +{ + # if mdadm has nothing to do when the raid is already loaded it exits with 2 + if [ $? -eq 0 -o $? -eq 2 ]; then + echo -e "${DONE}" + else + echo -e "${FAIL}" + sleep 5 + fi +} + start_raid() { MDCONFIG=/etc/mdadm/mdadm.conf @@ -72,7 +83,7 @@ mkdir -p ${MDCONFIG%/*} echo DEVICE partitions > $MDCONFIG mdadm --examine --scan >> $MDCONFIG - test_ok + test_mdadm_ok fi echo -ne "Assembling RAID arrays ... " @@ -82,7 +93,7 @@ sleep 1 echo -ne ". " mdadm --assemble --scan --run --auto=yes --homehost=ipcop --quiet - test_ok + test_mdadm_ok } @@ -116,7 +127,7 @@ mount -o ro -t ${ROOT_FSTYPE} ${ROOT} /harddisk test_ok - + echo -ne "Stopping udevd daemon ... " pkill udevd test_ok @@ -171,7 +182,7 @@ echo -ne "." && sleep 1 COUNT=$(( ${COUNT} - 1 )) done - + if [ ! -d /sys/block/${DEBUGDEV} ]; then echo -e "${FAIL}" echo "${DEBUGDEV} not available" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk _______________________________________________ Ipcop-svn mailing list Ipcop-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ipcop-svn