On Tue, Oct 12, 2010 at 3:22 AM, Denys Vlasenko <[email protected]> wrote: > On Tuesday 12 October 2010 00:19, Stuart Longland wrote: >> On 10/11/10 22:39, Monkey D. Luffy wrote: >> > After several hours of head banging I realized that busybox uses >> > builtins instead of the binaries in PATH. >> > Why is this the default behavior? > > These options are not on by default in build system. > > Whoever compiled your busybox copy turned them on deliberately.
Thanks for clearing that up. I'll contact the debian package manager to see if they can set busybox to the default behavior. >> > If the executables are in PATH it >> > would make sense that the user wants them to be used instead. >> > Is there a way to force busybox to use the executables in $PATH >> > instead of the builtins? > > IIRC in ash there is command builtin: "command foo" will run > external command foo. My problem (well, at least I thought it was that) was that another program was doing something like: exec (mount .....); So I couldn't really override it unless I changed the code and compiled that 3rd party program (and my goal was to keep things as unchanged as possible). I realized that wasn't the problem. I was having problems with mount (called by the 3rd party program) because I didn't have any mtab file, so I just linked /proc/mounts to it. That solved the problem. Before noticing that, I also came up with a work around which was to use another shell instead of busybox sh. Problem solved. Thanks. >> > Maybe setting a shell variable like: BB_PREFER_BUILTINS=no >> > Note that setting the full path to the executable, eg: /usr/sbin/mount >> > (I deleted the /bin/mount), doesn't solve the problem because is it >> > used in exec scenarios. > > I don't understand. > What do you refer to by the word "it" above? > > >> There's a .config option when building Busybox: >> >> BusyBox 1.17.1 Configuration >> ────────────────────────────────────────────────────────────────────── >> ┌─────────────────────── exec prefers applets ───────────────────────┐ >> │ CONFIG_FEATURE_PREFER_APPLETS: │ >> │ │ >> │ This is an experimental option which directs applets about to │ >> │ call 'exec' to try and find an applicable busybox applet before │ >> │ searching the PATH. This is typically done by exec'ing │ >> │ /proc/self/exe. │ >> │ This may affect shell, find -exec, xargs and similar applets. │ >> │ They will use applets even if /bin/<applet> -> busybox link │ >> │ is missing (or is not a link to busybox). However, this causes │ >> │ problems in chroot jails without mounted /proc and with ps/top │ >> │ (command name can be shown as 'exe' for applets started this way). │ >> │ │ >> │ Symbol: FEATURE_PREFER_APPLETS [=n] │ >> │ Prompt: exec prefers applets │ >> │ Defined at Config.in:373 │ >> │ Location: │ >> │ -> Busybox Settings │ >> │ -> General Configuration │ >> ├────────────────────────────────────────────────────────────(100%)──┤ >> │ < Exit > │ >> └────────────────────────────────────────────────────────────────────┘ >> >> Not sure why exec'ing to a full path is a problem however. IIRC that >> overrode this behaviour. > > Also, turn off SH_STANDALONE. > -- > vda > _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
