aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorKris Kennaway <kris@FreeBSD.org>2006-02-11 10:05:01 +0000
committerKris Kennaway <kris@FreeBSD.org>2006-02-11 10:05:01 +0000
commit89b70a6115851d322c9eb68e6ec924d38e0b18df (patch)
treebc582b689ef69c5bd1fe6d1521bd68babc8fcb66 /Tools
parent50a3a73c61c9124b5a7e773813919033e7b8b278 (diff)
downloadports-89b70a6115851d322c9eb68e6ec924d38e0b18df.tar.gz
ports-89b70a6115851d322c9eb68e6ec924d38e0b18df.zip
Notes
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/portbuild/scripts/clean-chroot10
1 files changed, 8 insertions, 2 deletions
diff --git a/Tools/portbuild/scripts/clean-chroot b/Tools/portbuild/scripts/clean-chroot
index a72238432574..24491e9f6820 100755
--- a/Tools/portbuild/scripts/clean-chroot
+++ b/Tools/portbuild/scripts/clean-chroot
@@ -3,10 +3,11 @@
kill_procs()
{
dir=$1
+ mount=$2
pids="XXX"
while [ ! -z "${pids}" ]; do
- pids=$(fstat -f "$dir" | tail +2 | awk '{print $3}' | sort -u)
+ pids=$(fstat -f "${dir}${mount}" | tail +2 | awk '{print $3}' | sort -u)
if [ ! -z "${pids}" ]; then
echo "Killing off pids in ${dir}"
ps -p $pids
@@ -26,7 +27,7 @@ cleanup_mount() {
umount ${chroot}${mount} || echo "Cleanup of ${chroot}${mount} failed!"
fi
if [ "${mdir}" = "${chroot}${mount}" ]; then
- kill_procs ${chroot}${mount}
+ kill_procs ${chroot} ${mount}
umount ${chroot}${mount} || echo "Cleanup of ${chroot}${mount} failed!"
fi
fi
@@ -55,6 +56,11 @@ if [ `realpath ${chroot}` = "/" ]; then
exit 1
fi
+if [ -f ${chroot}/tmp/jail.id ]; then
+ pgrep -lfj `awk '{print $1}' ${chroot}/tmp/jail.id`
+ pkill -j `awk '{print $1}' ${chroot}/tmp/jail.id`
+fi
+
#umount ${chroot}/proc
if [ ${arch} = "i386" ]; then