drinkcat / chroagh

Chromium OS Archlinux Chroot Environment
BSD 3-Clause "New" or "Revised" License
241 stars 27 forks source link

Chroots don't unmount #77

Open rperce opened 9 years ago

rperce commented 9 years ago

This last day or so every time I exit a chroot the unmount fails. It's not just my main chroot, either (see below), though something screwy is going on with the installation.

To test, I did:

  1. From main chroot, cd Downloads; rm -rf chroagh; git clone https://github.com/drinkcat/chroagh.
  2. Restart my chromebook.
  3. Open crosh window.
  4. Run cd ~/Downloads/chroagh; sudo sh -e installer/main.sh -n test -t core -r arch
  5. Observe that the installation of glib2 fails with tar: This does not look like a tar archive xz: (stdin): File format not recognized. I thought this was a network issue, but it's always glib2 that fails if anything fails. Maybe that mirror is messed up?
  6. Repeat step 4 until step 5 doesn't happen. Just now took 3 tries.
  7. Watch the pretty pacman install bars
  8. Note that the installation concludes with Not unmounting /mnt/stateful_partition/crouton/chroots/test as another instance is using it.. Be worried.
  9. Check sudo unmount-chroot -p test and see gpg-agent --homedir /etc/pacman.d/gnupg --use-standard-socket --daemon is still going.
  10. sudo enter-chroot and immediately exit in the hopes that gpg-agent just got momentarily confused.
  11. gpg-agent still going strong, unmount with sudo unmount-chroot -f test. It fails, select 'yes' to kill processes.
  12. sudo enter-chroot and immediately exit. See that Not unmounting /mnt/stateful_partition/crouton/chroots/test as another instance is using it. happened again.
  13. But this time sudo unmount-chroot -p test doesn't report anything? (steps 12-13 repeatable ad infitum to the limits of my patience)

In my main chroot, which has several other targets and a bunch of multilib stuff for running steam, it also fails to unmount on chroot exit, but it appears (from unmount-chroot -p) that dbus-daemon --system --fork is hanging around. I can produce whatever logs from that one you need.

Shadeslayer345 commented 9 years ago

I too am having this problem with the most recent update.

rperce commented 9 years ago

I have a slightly awkward workout for dbus-daemon hanging around:

sudo visudo and add the line %wheel: ALL=(ALL) NOPASSWD: /usr/bin/kill.

Then edit .bash_logout and add

sudo kill -9 `ps aux | egrep '^dbus' | awk '{print $2}'`

I found I also needed, before that line,

pulseaudio -k

but if you don't have pulseaudio you probably won't.

Obviously it works without the NOPASSWD specification but it's annoying to have to password after logging out. It's a little sketchy to give anyone who sits down at my computer kill for free but if they have physical access I'm probably boned anyways.

vendion commented 9 years ago

I am seeing this as well, I have just a base install of Arch, not running X11 or any audio services, and dbus-daemon continues to run. Short of SystemD I can't really think of anything I have installed that depends on dbus.

rperce commented 9 years ago

Update to The Hacky Workaround: I use tmux, which uses login shells by default (because... reasons!), so they trigger .bash_logout on exit, which led to sadness. Adding set -g default-command bash to .tmux.conf fixed that. Replace bash with zsh or fish or whatever.