Bug #12530

Feature #5630: Reproducible builds

Vagrant box creation fails: can't unmount chroot that's busy

Added by intrigeri 3 months ago. Updated about 2 months ago.

Status:ResolvedStart date:05/10/2017
Priority:HighDue date:
Assignee:-% Done:

100%

Category:Build system
Target version:Tails_3.0~rc1
QA Check:Pass Blueprint:
Feature Branch: Easy:
Type of work:Code Affected tool:

Description

Optimizing image for compression
Umounting /tmp/tmpvsGC26
EEEK! Something bad happened...
command failed: ['umount', '/tmp/tmpvsGC26']

umount: /tmp/tmpvsGC26: target is busy
        (In some cases useful info about processes that
         use the device is found by lsof(8) or fuser(1).)

Cleaning up
ERROR: /tmp/tmpvsGC26: Device or resource busy
rake aborted!

So I can't build any ISO since the last changes to our build system were merged.

It's kept busy by /tmp/tmpvsGC26/usr/sbin/sshd. Perhaps we need to stop the sshd service in the chroot at some point? But really, sshd should not even start in a chroot in the first place, so apparently something else is wrong, and it might be worth investigating to fix the root cause of the problem instead of workaround'ing it.

Associated revisions

Revision c66d361c
Added by intrigeri 3 months ago

vmdebootstrap: disable daemon startup/stopping when running postinstall.sh (refs: #12530).

Revision 348d4f85
Added by intrigeri 3 months ago

vmdebootstrap: disable daemon startup/stopping when running postinstall.sh (refs: #12530).

History

#1 Updated by intrigeri 3 months ago

Indeed, I see:

Setting up openssh-server (1:6.7p1-5+deb8u3) ...
Creating SSH2 RSA key; this may take some time ...
2048 59:67:84:a4:25:ab:41:e0:cc:7c:19:7c:c9:fc:bc:22 /etc/ssh/ssh_host_rsa_key.pub (RSA)
Creating SSH2 DSA key; this may take some time ...
1024 21:a4:9c:2e:6e:bf:35:c8:2c:d2:9e:90:01:67:cd:9c /etc/ssh/ssh_host_dsa_key.pub (DSA)
Creating SSH2 ECDSA key; this may take some time ...
256 16:a1:50:53:c6:8b:39:9f:08:20:76:7d:76:88:26:02 /etc/ssh/ssh_host_ecdsa_key.pub (ECDSA)
Creating SSH2 ED25519 key; this may take some time ...
256 3e:2b:6c:2c:0d:e8:41:52:6c:e0:2f:8b:58:97:b4:d5 /etc/ssh/ssh_host_ed25519_key.pub (ED25519)
Failed to read /proc/cmdline. Ignoring: No such file or directory
[ ok ] Starting OpenBSD Secure Shell server: sshd.

… which should never happen in a chroot usually. Is vmdebootstrap doing something weird that prevents detection of the chroot, or are we?

#2 Updated by intrigeri 3 months ago

  • Status changed from Confirmed to In Progress
  • Assignee changed from bertagaz to intrigeri

vmdebootstrap has code to disable/enable daemons startup: see disable_daemons, remove_daemon_block and common/jessie-arm64-hook.sh in its source tree. I think that vagrant/definitions/tails-builder/customize.sh should call these two functions around the call to postinstall.sh. Will try.

#3 Updated by intrigeri 3 months ago

  • Assignee changed from intrigeri to anonym
  • % Done changed from 0 to 50
  • QA Check set to Ready for QA

Pushed my fix to feature/stretch.

#4 Updated by anonym 3 months ago

  • Status changed from In Progress to Resolved
  • Assignee deleted (anonym)
  • % Done changed from 50 to 100
  • QA Check changed from Ready for QA to Pass

Works for me! Note that one is not affected by this bug if the host has sshd listening on the default interface/port (*:22) since that prevents sshd in the chroot from starting (since the port is busy). That explains why some of us experienced this, and some don't.

I cherry-picked the fix into stable and devel, and also pushed a short comment for this rather arcane workaround.

Also available in: Atom PDF