]> git.entuzijast.net Git - imunes.git/commitdiff
A race condition could occur in vimageCleanup when processes inside a
authormarko <marko>
Wed, 27 Jul 2005 05:40:10 +0000 (05:40 +0000)
committermarko <marko>
Wed, 27 Jul 2005 05:40:10 +0000 (05:40 +0000)
dying vimage would be shutting down too slow.  This would occur
particularly often with XORP.  The vimage shutdown is now performed in
a loop to ensure we do not proceed further until the cleanup has
completely succedded.

Bug found by:
Submitted by:
Requested by:
Reviewed by:
Approved by:
Obtained from:

exec.tcl

index dff4ddf186bdbc3b29204ac371f0611c788830b1..9b88a37f56fdb3afb2f9d2f1db904a4f123f6ca8 100755 (executable)
--- a/exec.tcl
+++ b/exec.tcl
@@ -323,13 +323,17 @@ proc vimageCleanup {} {
 
     # Shut down all vimages
     foreach vimage $vimages {
-       statline "Shutting down vimage $vimage"
+       set stattxt "Shutting down vimage $vimage"
+       statline $stattxt
        catch {nexec vimage $vimage kill -9 -1 2> /dev/null}
+       while { [catch {nexec vimage -d $vimage}] } {
+           set stattxt $stattxt.
+           statline $stattxt
+           catch {nexec vimage $vimage kill -9 -1 2> /dev/null}
+       }
        nexec rm -fr /tmp/$vimage
-       nexec vimage -d $vimage
     }
     catch { nexec rm -f /usr/local/etc/quagga/Quagga.conf }
-    catch { nexec rm -f /usr/local/xorp/config.boot }
     catch { nexec mv /etc/resolv.conf.bak /etc/resolv.conf }
     statline "Cleanup completed in [expr [clock seconds] - $t_start] seconds."
 }