From: <sal...@li...> - 2011-11-18 16:47:14
|
Revision: 2793 http://salix.svn.sourceforge.net/salix/?rev=2793&view=rev Author: jrdasm Date: 2011-11-18 16:47:07 +0000 (Fri, 18 Nov 2011) Log Message: ----------- Umount modules in the reverse order. Try to find a way to prevent lock when killing process or umounting union. Modified Paths: -------------- salt/trunk/initrd-template/cleanup salt/trunk/initrd-template/lib/libSaLT Modified: salt/trunk/initrd-template/cleanup =================================================================== --- salt/trunk/initrd-template/cleanup 2011-11-18 16:44:23 UTC (rev 2792) +++ salt/trunk/initrd-template/cleanup 2011-11-18 16:47:07 UTC (rev 2793) @@ -88,7 +88,7 @@ debugshell infolog 'Unloading modules...' -for m in /mnt/modules/*; do +for m in $(ls -dr1 /mnt/modules/*); do infolog " - Unloading $m" unload_module "$m" debugshell Modified: salt/trunk/initrd-template/lib/libSaLT =================================================================== --- salt/trunk/initrd-template/lib/libSaLT 2011-11-18 16:44:23 UTC (rev 2792) +++ salt/trunk/initrd-template/lib/libSaLT 2011-11-18 16:47:07 UTC (rev 2793) @@ -632,16 +632,22 @@ echodebug "ignorelst $ignorelst" lst= for pid in $(ps|grep -v 'PID USER'|grep -v ' \[[^ ]*\]$'|grep -v mount|grep -v ntfs|cut -d' ' -f2|sort -r); do - if [ $pid -lt $PID -a $pid -ne 1 -a -z "$(echo $ignorelst|grep :$pid:)" ]; then + if [ $pid -lt $PID -a $pid -gt 1 -a -z "$(echo $ignorelst|grep :$pid:)" ]; then lst="$lst $pid" fi done echodebug "kill list: $lst" debugshell - kill -15 $lst 2>/dev/null - sleep 1 - kill -9 $lst 2>/dev/null - sleep 1 + if [ -n "$lst" ]; then + echodebug "kill -15 $lst" + kill -15 $lst 2>/dev/null + sleep 1 + echodebug "kill -9 $lst" + kill -9 $lst 2>/dev/null + sleep 1 + fi + echodebug "kill -9 $PID" + kill -9 $PID } # Umount all sub-mounts that appear inside the specified mountpoint. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |