[Trisquel-devel] [PATCH] guard fuser -k in createjail against there being no open file handles

Andrew 'Leny' Lindley andrew at andrewlindley.co.uk
Fri Oct 10 10:06:33 CEST 2014


The existing 'fuser -k $CHROOT-tmp' causes makepackage to fail when
there are no open file handles in the tmp jail because fuser is
designed to return exit code 1 in that circumstance.  So I've put a
guard on it which tests for open handles.  It will swallow fatal
errors as well - but the user should find out soon enough from other
commands. :-)

It was tested by the build for the ckermit patch. 

Leny

-- >8 --

Subject: [PATCH] guard fuser -k in createjail against there being no open file handles
---
 makepackage | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/makepackage b/makepackage
index 3e231ba..0fa839c 100644
--- a/makepackage
+++ b/makepackage
@@ -94,7 +94,7 @@ createjail () {
     mkdir $CHROOT-tmp
     mount -t tmpfs -o size=500M none $CHROOT-tmp
     debootstrap --arch=$JAILARCH $UPSTREAM $CHROOT-tmp $MIRROR
-    fuser -k $CHROOT-tmp
+    fuser -s $CHROOT-tmp && fuser -k $CHROOT-tmp
     cp -a $CHROOT-tmp $CHROOT
     umount $CHROOT-tmp
     rm $CHROOT-tmp -rf
-- 
1.9.1



More information about the Trisquel-devel mailing list