dnschneid/crouton — pull request #876 by drinkcat (2014-06-08 04:03:03+00:00)
Title: umount-chroot: Call umount one mount point at a time

umount, called with multiple parameters, may return 0 when many mount points cannot be unmounted, due to an overflow in its exit code (see https://github.com/karelzak/util-linux/pull/96). We are unlucky enough to have exactly 8 umount failures (8*32=256 overflows to 0, meaning success), which leads `unmount-chroot` not to attempt to kill processes (including xbindkeys). Then it appears that we hit the bug in `xbindkeys` (#759), and it does not react to further keystrokes.

We fix this by passing `-L 1` to `xargs`.

Finally, we sort mount points to minimize the number of loops required (so subdirectories are unmounted first).

This fixes part of the problem in #754. But I think `croutonxinitrc-wrapper` should still kill xbindkeys properly (it does on SIGHUP/SIGTERM, but not on normal exit), and not rely on `unmount-chroot`. I'll fix that too.