blob: 79fe31d8541a7db1fcc6283b0e2d776a071add98 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
--- ./lib/tinderlib.sh.orig 2009-02-24 21:36:38.000000000 +0200
+++ ./lib/tinderlib.sh 2009-03-25 06:14:12.238205132 +0200
@@ -23,7 +23,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $MCom: portstools/tinderbox/lib/tinderlib.sh,v 1.55.2.4 2008/11/10 07:03:02 marcus Exp $
+# $MCom: portstools/tinderbox/lib/tinderlib.sh,v 1.55.2.5 2009/03/14 23:57:13 marcus Exp $
#
tinderLocJail () {
@@ -131,7 +131,14 @@
pids="XXX"
while [ ! -z "${pids}" ]; do
- pids=$(fstat -f "${dir}" | tail +2 | awk '{print $3}' | sort -u)
+ # Lsof is more reliable when it comes to nullfs, so prefer it if
+ # found.
+ lsof=$(which lsof 2>/dev/null)
+ if [ -n "${lsof}" ]; then
+ pids=$(${lsof} | fgrep "${dir}" | awk '{print $2}' | sort -u)
+ else
+ pids=$(fstat -f "${dir}" | tail +2 | awk '{print $3}' | sort -u)
+ fi
if [ ! -z "${pids}" ]; then
echo "Killing off pids in ${dir}"
|