From: <er...@he...> - 2004-02-23 20:03:53
|
On Mon, Feb 23, 2004 at 12:42:43AM +0100, J.A. Magallon wrote: > Hi all... > > I have a problem when launcing remote scripts with bpsh. > I have a soft that I build with different compilers, and stored like > > /opt/aleph/bin/tst Shell script > /opt/aleph/bin/linux-gcc/tst Binary > /opt/aleph/bin/linux-icc/tst Binary > /opt/aleph/bin/default -> linux-gcc Deafult build I want to use > > The script does something like: > > #!/bin/bash > > /opt/aleph/bin/default/$(basename $0) > > Just try this: > > #!/bin/bash > > echo $0 > > The result is: > > annwn:~> bpsh 0 tst > /proc/self/fd/3 > > Uh ? > Something is missing in rfork/rexec to set up properly script names ? Hehe. You've discovered the wacky shell script hack that I put in a while ago. The problem with shell scripts is that then the kernel sees '#!/bin/sh' in a script called X it actually does execve("/bin/sh", "X", 0). X isn't going to exist on the nodes most of the time. This is true in my world anyway. BProc, in an attempt to be tricky and get around this, puts the script in the process's memory space and then gives you this file descriptor on fd 3 that magically just reads the file from your own memory space. This made a few perl users very happy a while ago. If you don't want this hack, put a zero in /proc/sys/bproc/shell_hack. - Erik |