[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Weird interaction between chroot jail and shell-mode
From: |
Pascal J. Bourguignon |
Subject: |
Re: Weird interaction between chroot jail and shell-mode |
Date: |
Wed, 08 Dec 2010 15:33:59 -0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Sean McAfee <eefacm@gmail.com> writes:
> This is probably the most perplexing Emacs issue I've ever
> encountered...
>
> I've been trying to build the debian "apt" package in a shell-mode bash
> shell, inside of which I've entered a chroot jail. The build process
> (initiated with the command "dpkg-buildpackage") would reach a point
> where it executes the command:
>
> po4a --previous --no-backups po4a.conf
>
> ...whereupon the command hangs, consuming 100% of the CPU until I kill
> it.
>
> A co-worker had no trouble building the package in an ordinary terminal
> window on his own machine, and, unable to find any reason for my issue,
> suggested that Emacs might be to blame. I was dubious, to say the
> least, but to humor him I repeated the process in my own terminal
> window. To my astonishment, the package didn't get hung up on the po4a
> command, but ran to completion successfully.
>
> I tried building the package inside a terminal emulator window inside
> Emacs. It built. I tried again using eshell, which I ordinarily never
> use. The build got hung up at the same point as originally, with the
> additional delightfulness that I couldn't interrupt the hung command
> with C-c C-c. Finally, I tried building the package in a shell-mode
> shell again, but without entering the chroot jail. It built. WTF.
>
> I tried dumping my environment variables in the jail in shell-mode and
> term-mode and comparing them. The only differences were in OLDPWD,
> LSCOLORS, and TERM ("dumb" in shell-mode, "vt100" in term-mode). I
> repeated the build in shell-mode after setting TERM to vt100, but it
> still got hung.
>
> I am utterly perplexed. Does anyone have any possible explanation for
> the behavior I'm seeing? How in the world can any command produce
> different behavior when run inside vs. outside of a chroot jail, but
> only when run from a bash shell which itself is running inside a
> shell-mode buffer?
In the root jail, have you mounted /proc and /dev ?
Without that, since the stdin stdout are not normal ptys, when you use
M-x shell, it may try to access the device and if not found that could
be the cause of the hang. Perhaps.
mount -t proc proc $ROOT_JAIL/proc
mount -o bind /dev $ROOT_JAIL/dev
--
__Pascal Bourguignon__ http://www.informatimago.com/