mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
integrate-distro.sh: Trying to find and kill processes blocking chroot unmount
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
3e03f0884b
commit
2e3fba5792
1 changed files with 14 additions and 0 deletions
|
|
@ -818,12 +818,26 @@ mount_devices()
|
|||
}
|
||||
}
|
||||
|
||||
kill_chroot_processes()
|
||||
{
|
||||
local pids=`ls -l /proc/*/root | grep $root | sed "s%.* /proc/\([0-9]\+\)/.*%\1%"`
|
||||
local wait
|
||||
local p
|
||||
for p in $pids; do
|
||||
echo "killing process $pid (`strings /proc/$p/cmdline | sed ':a;N;$!ba;s/\n/ /g'`)"
|
||||
kill $p
|
||||
wait=1
|
||||
done
|
||||
[ wait = 1 ] && sleep 1
|
||||
}
|
||||
|
||||
unmount_devices()
|
||||
{
|
||||
local devices="$ssh_auth_sock /srv/ftp /proc/fs/nfsd /proc /sys /dev /boot /"
|
||||
[ "$1" ] && devices="$@"
|
||||
local sync=/usr/bin/sync
|
||||
[ -x $root/$sync ] || sync=""
|
||||
kill_chroot_processes
|
||||
local d
|
||||
for d in $devices; do
|
||||
check_mount $d && {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue