tfixed slam for a single tomb - tomb - the crypto undertaker
HTML git clone git://parazyd.org/tomb.git
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit ccdd2aa4d6a1d798e6cd4d53ed38d34cd4dc0743
DIR parent 7345596f79a76bac7f9dfc39999542af6f9ecc3d
HTML Author: Jaromil <jaromil@dyne.org>
Date: Sun, 15 May 2011 20:03:11 +0200
fixed slam for a single tomb
still need to debug "tomb slam all"
Diffstat:
M src/tomb | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
---
DIR diff --git a/src/tomb b/src/tomb
t@@ -777,10 +777,17 @@ umount_tomb() {
if [ $SLAM ]; then
notice "Slamming tomb $tombname mounted on $tombmount"
act "Kill all processes busy inside the tomb"
+ pidk=`lsof -t "$tombmount"`
+ for p in "$pidk"; do
+ pname=`pidof $p`
+ func "killing PID $p of $pname..."
+ kill -9 $p
+ done
else
notice "Closing tomb $tombname mounted on $tombmount"
fi
- # check if there are binded dirs and close them first
+
+ # check if there are binded dirs and close them
tombmount_esc=`sed 's:\/:\\\/:g' <<< $tombmount `
unbind=`mount | awk "/^$tombmount_esc.*bind/"' { print $3 }'`
for b in ${(f)unbind}; do
t@@ -814,19 +821,6 @@ umount_tomb() {
umount ${tombmount} 2> /dev/null
if ! [ $? = 0 ]; then
error "Tomb is busy, cannot umount!"
- if [ $SLAM ]; then
- notice "Slamming tomb killing all processes using it"
- pidk=`lsof -t "$tombmount"`
- for p in "$pidk"; do
- pname=`pidof $p`
- func "killing PID $p of $pname..."
- kill -9 $p
- done
- umount "${tombmount}"
- else
- error "Cannot umount $tombname on $tombmount"
- return 1
- fi
fi
fi