lsof: WARNING: can't stat(/root/uml-834523023462431000/root_fs/var/run/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.speech-dispatcher/.speech-dispatcher/.speech-dispatcher/.cache/speech-dispatcher/.speech-dispatcher/.cache/speech-dispatcher/.speech-dispatcher/.cache/speech-dispatcher) symbolc link: Too many levels of symbolic links
lsof: WARNING: can't stat(/root/uml-834523023462431000/root_fs/var/run/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.cache/speech-dispatcher/.speech-dispatcher/.speech-dispatcher/.speech-dispatcher/.cache/speech-dispatcher/.speech-dispatcher/.speech-dispatcher/.cache/speech-dispatcher/log) symbolc link: Too many levels of symbolic links
exec > >(tee -a "$logfile") 2> >(tee -a "$logfile" >&2)
basedir=uml-834523023462431000
thePrefix=~/"$basedir"/root_fs_img
function finish_Inner_Func {
pushd ~
lsof ~/"$basedir"/root_fs_img
echo ~/"$basedir"/root_fs
lsof ~/"$basedir"/root_fs
lsof ~/"$basedir"/buster_uml
read -r "Press any key to resume ..."
read -r "Press any key to resume ..."
read -r "Press any key to resume ..."
echo "Trying to clean up Chroots that are left hanging..."
umount ~/"$basedir"/root_fs_img/sys || echo "can't unmount sys"
umount ~/"$basedir"/proc/sys/fs/binfmt_misc
umount ~/"$basedir"/root_fs_img/proc || echo "can't unmount proc"
umount ~/"$basedir"/root_fs_img/dev/pts || echo "can't unmount dev pts"
umount ~/"$basedir"/root_fs_img/dev || echo "can't unmount dev"
umount --recursive /root/"$basedir"/root_fs_img
umount --recursive /root/"$basedir"/root_fs
umount --recursive /root/"$basedir"
umount ~/"$basedir"/root_fs_img || echo "can't unmountroot_fs_img" || exit
pushd ~ || exit
umount ~/"$basedir"/root_fs
echo ~/"basedir"/root_fs_img
lsof ~/"$basedir"/root_fs_img
echo ~/"$basedir"/root_fs
lsof ~/"$basedir"/root_fs
}
#trap finish_Inner_Func EXIT
function old_kill_proc {
thePrefix=~/"$basedir"
whatsFound=0
for root_file_Systems in /proc/*/root; do
theLinks=$(readlink "$root_file_Systems")
if [ "$theLinks" != "x" ]; then
if [ "${theLinks:0:${#the_Prefix}}" = "$thePrefix" ]; then
# this process is in the chroot... thePID="$(basename "$(dirname "$root_file_Systems")")"
kill -9 "$thePID" whatsFound=1
fi
fi
done
if [ "$whatsFound" = "x1" ]; then
while grep -q "$thePrefix" /proc/mounts; do
counters=$counters+1
if [ "$counters" -ge 20 ]; then
echo "failed to umount $thePrefix"
if [ -x /usr/bin/lsof ]; then /usr/bin/lsof "$thePrefix"
fi
fi
grep "$thePrefix" /proc/mounts | \
cut -d\ -f2 | LANG=C sort -r | xargs -r -n 1 umount || sleep 1
done # repeat the above, the script I'm cargo-culting this from just re-execs itself
fi
}
# -o Dpkg::Options::=--force-confdef \
function chroot_Function {
success_chroot=0
echo "made it to build root?"
mount --rbind /dev ~/"$basedir"/root_fs/dev && echo "mounted dev" && success_chroot=1
mount devpts -t devpts --rbind /dev/pts ~/"$basedir"/root_fs/dev/pts && echo "mounted pts" && success_chroot=1
mount --rbind /proc -t proc ~/"$basedir"/root_fs/proc && echo "mounted proc" && success_chroot=1
mount --rbind /sys ~/"$basedir"/root_fs/sys && echo "mounted sys" && success_chroot=1
if ((! success_chroot==4)); then
printf 'setting up bindings for the chrooot was unsuccessful\n' 1>&2
exit 1
fi
}
if [[ -d ~/"$basedir" ]]
then
printf '%s exists on your filesystem ... removing:\n ' "$basedir" && finish_Inner_Func && mkdir ~/"$basedir"
else
printf 'basedir: does not exist so I will create root %s\n ' "$basedir" && mkdir ~/"$basedir"
if ! mkdir -p ~/"$basedir"/root_fs/usr/lib/modules/; then
printf 'failed to create lib modules directory\n' 1>&2
exit 1
fi
#if ! rsync -raHAXS /lib/modules/ ~/"$basedir"/root_fs/usr/lib/modules/; then
# printf 'rsync was not succesful files not propelry copied to the image file\n' 1>&2
# exit 1
#fi
echo 'End of SCRIPT_Inner...'
finish_Inner_Func
produces this lsof output :
Filename: None. Size: 8kb. View raw, copy, hex, or download this file.
View source code, the removal or expiry stories, or read the about page.
This website does not claim ownership of, copyright on, and assumes no liability for provided content. Toggle color scheme.
This paste expires on 2022-06-22 17:43:10.762812. Remove now. Repaste, or download this paste. Toggle word wrap. Pasted through web.
NOTE: the temporary exit of this script at the line:
' echo "temporary exit to make sure nothing else is screwing it up" && exit '
produces this error:
command: sudo lsof -x +D /root/uml- 834523023462431 000
lsof: WARNING: can't stat(/root/ uml-83452302346 2431000/ root_fs/ var/run/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .speech- dispatcher/ .speech- dispatcher/ .speech- dispatcher/ .cache/ speech- dispatcher/ .speech- dispatcher/ .cache/ speech- dispatcher/ .speech- dispatcher/ .cache/ speech- dispatcher) symbolc link: Too many levels of symbolic links uml-83452302346 2431000/ root_fs/ var/run/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .cache/ speech- dispatcher/ .speech- dispatcher/ .speech- dispatcher/ .speech- dispatcher/ .cache/ speech- dispatcher/ .speech- dispatcher/ .speech- dispatcher/ .cache/ speech- dispatcher/ log) symbolc link: Too many levels of symbolic links
lsof: WARNING: can't stat(/root/
#!/bin/bash -x
function aptUpdate_Inner { FRONTEND= noninteractive \ :=--force- confold \ remove- essential --allow- change- held-packages
DEBIAN_
apt-get update \
-o Dpkg::Options:
-y --allow-downgrades --allow-
}
aptUpdate_Inner
# https:/ /askubuntu. com/questions/ 401454/ how-to- get-sudo- access- to-shares- mounted- by-gigolo
logfile= dies_Inner- 11.log
[ -e ~/"$logfile" ] || rm -rf "$logfile"
exec > >(tee -a "$logfile") 2> >(tee -a "$logfile" >&2)
basedir= uml-83452302346 2431000
thePrefix= ~/"$basedir" /root_fs_ img
function finish_Inner_Func { /root_fs_ img /root_fs /root_fs /buster_ uml /root_fs_ img/sys || echo "can't unmount sys" /proc/sys/ fs/binfmt_ misc /root_fs_ img/proc || echo "can't unmount proc" /root_fs_ img/dev/ pts || echo "can't unmount dev pts" /root_fs_ img/dev || echo "can't unmount dev" $basedir" /root_fs_ img $basedir" /root_fs /root_fs_ img || echo "can't unmountroot_fs_img" || exit /root_fs /root_fs_ img /root_fs_ img /root_fs /root_fs
pushd ~
lsof ~/"$basedir"
echo ~/"$basedir"
lsof ~/"$basedir"
lsof ~/"$basedir"
read -r "Press any key to resume ..."
read -r "Press any key to resume ..."
read -r "Press any key to resume ..."
echo "Trying to clean up Chroots that are left hanging..."
umount ~/"$basedir"
umount ~/"$basedir"
umount ~/"$basedir"
umount ~/"$basedir"
umount ~/"$basedir"
umount --recursive /root/"
umount --recursive /root/"
umount --recursive /root/"$basedir"
umount ~/"$basedir"
pushd ~ || exit
umount ~/"$basedir"
echo ~/"basedir"
lsof ~/"$basedir"
echo ~/"$basedir"
lsof ~/"$basedir"
}
#trap finish_Inner_Func EXIT
function old_kill_proc {
thePrefix= ~/"$basedir" $(readlink "$root_ file_Systems" ) 0:${#the_ Prefix} }" = "$thePrefix" ]; then
thePID= "$(basename "$(dirname "$root_ file_Systems" )")"
whatsFound =1
whatsFound=0
for root_file_Systems in /proc/*/root; do
theLinks=
if [ "$theLinks" != "x" ]; then
if [ "${theLinks:
# this process is in the chroot...
kill -9 "$thePID"
fi
fi
done
if [ "$whatsFound" = "x1" ]; then
while grep -q "$thePrefix" /proc/mounts; do $counters+ 1
/usr/ bin/lsof "$thePrefix"
counters=
if [ "$counters" -ge 20 ]; then
echo "failed to umount $thePrefix"
if [ -x /usr/bin/lsof ]; then
fi
fi
grep "$thePrefix" /proc/mounts | \
cut -d\ -f2 | LANG=C sort -r | xargs -r -n 1 umount || sleep 1
done # repeat the above, the script I'm cargo-culting this from just re-execs itself
fi
}
# -o Dpkg::Options: :=--force- confdef \
function chroot_Function { /root_fs/ dev && echo "mounted dev" && success_chroot=1 /root_fs/ dev/pts && echo "mounted pts" && success_chroot=1 /root_fs/ proc && echo "mounted proc" && success_chroot=1 /root_fs/ sys && echo "mounted sys" && success_chroot=1
success_chroot=0
echo "made it to build root?"
mount --rbind /dev ~/"$basedir"
mount devpts -t devpts --rbind /dev/pts ~/"$basedir"
mount --rbind /proc -t proc ~/"$basedir"
mount --rbind /sys ~/"$basedir"
if ((! success_ chroot= =4)); then
printf 'setting up bindings for the chrooot was unsuccessful\n' 1>&2
exit 1
fi
}
if [[ -d ~/"$basedir" ]]
then
printf '%s exists on your filesystem ... removing:\n ' "$basedir" && finish_Inner_Func && mkdir ~/"$basedir"
else
printf 'basedir: does not exist so I will create root %s\n ' "$basedir" && mkdir ~/"$basedir"
fi
#chown -R "$USER:$USER" buster-uml
#chmod a+rwx buster-uml
fallocate -l 2G ~/"$basedir" /root_fs_ img
mkfs -t ext4 ~/"$basedir" /root_fs_ img
mkdir ~/"$basedir" /root_fs /root_fs_ img ~/"$basedir" /root_fs /root_fs
mount -t ext4 ~/"$basedir"
mount -o remount, rw ~/"$basedir"
pushd ~/"$basedir" || printf 'failed to change the directory: /root/ %s \n' ~/"$basedir" debootstrap --arch amd64 --variant minbase buster ~/"$basedir" /root_fs/ http:// deb.debian. org/debian
/usr/sbin/
echo "temporary exit to make sure nothing else is screwing it up" && exit
#rsync --verbose --archive --one-file-system --xattrs --hard-links --numeric-ids --sparse --acls buster-uml/ root_fs/
echo '/dev/ubd0 ext4 discard, errors= remount- ro 0 ' >> ~/"$basedir" /root_fs/ etc/fstab
#if ! chroot ~/"$basedir" /root_fs_ img /usr/bin/passwd; then
# printf 'failed to successfully execute the chroot\n' 1>&2
# exit 1
#fi
#if ! source /etc/environment; then
# printf 'failed to source environment\n' 1>&2
# exit 1
#fi
chroot_Function
if ! DEBIAN_ FRONTEND= noninteractive apt update -y; then
printf 'unable to install apt updates' 1>&2
exit 1
fi
if ! DEBIAN_ FRONTEND= noninteractive apt install ifupdown -y -q; then
printf 'unable to install networking properly\n' 1>&2
exit 1
fi
random_ file="UML- $(shuf -i 2000000-7000000 -n 1))" hostname= "$random_ file"
random_
if ! echo "$random_hostname" > ~/"$basedir" /root_fs/ etc/hostname; then
printf 'failed to install random hostname\n' 1>&2
exit 1
fi
~/"$basedir" /root_fs/ etc/network/ interfaces <<'interfaces_EOF'
# legacy UML network devices
auto eth0
iface eth0 inet dhcp
# vector UML network devices
auto vec0
iface vec0 inet dhcp
interfaces_EOF
if ! mkdir -p ~/"$basedir" /root_fs/ usr/lib/ modules/ ; then
printf 'failed to create lib modules directory\n' 1>&2
exit 1
fi
#if ! rsync -raHAXS /lib/modules/ ~/"$basedir" /root_fs/ usr/lib/ modules/ ; then
# printf 'rsync was not succesful files not propelry copied to the image file\n' 1>&2
# exit 1
#fi
echo 'End of SCRIPT_Inner...'
finish_Inner_Func
produces this lsof output :
Filename: None. Size: 8kb. View raw, copy, hex, or download this file.
View source code, the removal or expiry stories, or read the about page.
This website does not claim ownership of, copyright on, and assumes no liability for provided content. Toggle color scheme.