Using a dedicated (i.e. used defined) /tmp disk / volume / mount-point, dib currently fails with:
2017-09-23 15:04:29.043 INFO diskimage_builder.block_device.utils [-] Calling [sudo umount /tmp/dib_build.mTZQWuvY/mnt/tmp]
2017-09-23 15:04:29.051 DEBUG diskimage_builder.block_device.utils [-] exec_sudo: umount: /tmp/dib_build.mTZQWuvY/mnt/tmp: target is busy exec_sudo /data/home/dib/DIB/diskimage-
builder/diskimage_builder/block_device/utils.py:120
2017-09-23 15:04:29.051 DEBUG diskimage_builder.block_device.utils [-] exec_sudo: (In some cases useful info about processes that exec_sudo /data/home/dib/DIB/diskimage-builder/diskimage_builder/block_device/utils.py:120
2017-09-23 15:04:29.052 DEBUG diskimage_builder.block_device.utils [-] exec_sudo: use the device is found by lsof(8) or fuser(1).) exec_sudo /data/home/dib/DIB/diskimage-builder/diskimage_builder/block_device/utils.py:120
Traceback (most recent call last):
File "/data/home/dib/DIB/venv/bin/dib-block-device", line 10, in <module>
sys.exit(main())
File "/data/home/dib/DIB/diskimage-builder/diskimage_builder/block_device/cmd.py", line 120, in main
return bdc.main()
File "/data/home/dib/DIB/diskimage-builder/diskimage_builder/block_device/cmd.py", line 115, in main
self.args.func()
File "/data/home/dib/DIB/diskimage-builder/diskimage_builder/block_device/cmd.py", line 39, in cmd_umount
self.bd.cmd_umount()
File "/data/home/dib/DIB/diskimage-builder/diskimage_builder/block_device/blockdevice.py", line 420, in cmd_umount
node.umount()
File "/data/home/dib/DIB/diskimage-builder/diskimage_builder/block_device/level3/mount.py", line 109, in umount
exec_sudo(["umount", self.state['mount'][self.mount_point]['path']])
File "/data/home/dib/DIB/diskimage-builder/diskimage_builder/block_device/utils.py", line 125, in exec_sudo
' '.join(sudo_cmd))
subprocess.CalledProcessError: Command 'sudo umount /tmp/dib_build.mTZQWuvY/mnt/tmp' returned non-zero exit status 32
A analyze shows, that the mount / umounts are not called in the correct order in this case:
Sep 23 15:04:24 deb-mirror sudo[12723]: dib : TTY=pts/1 ; PWD=/data/home/dib/DIB/infra-build-images ; USER=root ; COMMAND=/bin/mount --bind /tmp/dib_build.mTZQWuvY/hooks /tmp/dib_build.mTZQWuvY/mnt/tmp/in_target.d
Sep 23 15:04:24 deb-mirror sudo[12727]: dib : TTY=pts/1 ; PWD=/data/home/dib/DIB/infra-build-images ; USER=root ; COMMAND=/bin/mount -o remount,ro,bind /tmp/dib_build.mTZQWuvY/hooks /tmp/dib_build.mTZQWuvY/mnt/tmp/in_target.d
Sep 23 15:04:28 deb-mirror sudo[12809]: dib : TTY=pts/1 ; PWD=/data/home/dib/DIB/infra-build-images ; USER=root ; COMMAND=/bin/umount /tmp/dib_build.mTZQWuvY/mnt/data
Sep 23 15:04:28 deb-mirror sudo[12815]: dib : TTY=pts/1 ; PWD=/data/home/dib/DIB/infra-build-images ; USER=root ; COMMAND=/bin/umount /tmp/dib_build.mTZQWuvY/mnt/var/tmp
Sep 23 15:04:28 deb-mirror sudo[12821]: dib : TTY=pts/1 ; PWD=/data/home/dib/DIB/infra-build-images ; USER=root ; COMMAND=/bin/umount /tmp/dib_build.mTZQWuvY/mnt/var/log
Sep 23 15:04:28 deb-mirror sudo[12827]: dib : TTY=pts/1 ; PWD=/data/home/dib/DIB/infra-build-images ; USER=root ; COMMAND=/bin/umount /tmp/dib_build.mTZQWuvY/mnt/home
Sep 23 15:04:29 deb-mirror sudo[12833]: dib : TTY=pts/1 ; PWD=/data/home/dib/DIB/infra-build-images ; USER=root ; COMMAND=/bin/umount /tmp/dib_build.mTZQWuvY/mnt/tmp
So 'umount /mnt/tmp' is called - even if /mnt/tmp/in_target.d is still mounted.
Using today's master (commit ab1ed1e59a3dd73c66f7bed9823d1d0a74d02244)
Fix proposed to branch: master /review. openstack. org/506865
Review: https:/