mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2025-02-08 23:08:32 +00:00
FIX (tries) #77: slam wasn't slamming
That's because fuser behaves differently on debian. (Why, debian, why???)
This commit is contained in:
parent
86fc6e67a8
commit
d57994fcc3
1
.gitignore
vendored
1
.gitignore
vendored
@ -28,3 +28,4 @@ tags
|
|||||||
doc/web/public
|
doc/web/public
|
||||||
doc/web/dyne
|
doc/web/dyne
|
||||||
share/gtkrc
|
share/gtkrc
|
||||||
|
.*.sw?
|
||||||
|
25
src/tomb
25
src/tomb
@ -949,9 +949,25 @@ mount_tomb() {
|
|||||||
# Kill all processes using the tomb
|
# Kill all processes using the tomb
|
||||||
slam_tomb() {
|
slam_tomb() {
|
||||||
# $1 = tomb mount point
|
# $1 = tomb mount point
|
||||||
for s in INT TERM HUP KILL; do
|
if [[ -z `fuser -m "$1" 2> /dev/null` ]]; then
|
||||||
fuser -s -m "$1" || return 0
|
return 0
|
||||||
fuser -s -m "$1" -k -M -$s && { option_is_set -f || sleep 3 }
|
fi
|
||||||
|
#Note: shells are NOT killed by INT or TERM, but they are killed by HUP
|
||||||
|
for s in TERM HUP KILL; do
|
||||||
|
xxx "Sending $s to processes inside the tomb:"
|
||||||
|
if option_is_set -D; then
|
||||||
|
ps -fp `fuser -m /media/a.tomb 2> /dev/null`|
|
||||||
|
while read line; do
|
||||||
|
xxx $line
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
fuser -s -m "$1" -k -M -$s
|
||||||
|
if [[ -z `fuser -m "$1" 2> /dev/null` ]]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
if ! option_is_set -f; then
|
||||||
|
sleep 3
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
@ -1030,8 +1046,7 @@ umount_tomb() {
|
|||||||
if [ $SLAM ]; then
|
if [ $SLAM ]; then
|
||||||
_success "Slamming tomb $tombname mounted on $tombmount"
|
_success "Slamming tomb $tombname mounted on $tombmount"
|
||||||
_message "Kill all processes busy inside the tomb"
|
_message "Kill all processes busy inside the tomb"
|
||||||
slam_tomb "$tombmount"
|
if ! slam_tomb "$tombmount"; then
|
||||||
if [[ $? == 1 ]]; then
|
|
||||||
_warning "Cannot slam the tomb $tombname"
|
_warning "Cannot slam the tomb $tombname"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user