Wednesday, May 27, 2009

export over ssh stdio

So, I've modified the lcmd stuff a bit and am able to mount a remote inferno instance that I start with an os ssh:

(local script)
#!/dis/sh

load std expr string
args := $*
s := sh -c ${quote $"args}
mkdir -p /tmp/lpipe
bind '#|' /tmp/lpipe
echo os
os ssh $remote /home/ericvh/inferno/Linux/power/bin/emu -I -r /home/ericvh/inferno /dis/sshexport /tmp/lpipe/data1 &
echo shell
mount -A /tmp/lpipe/data /n/remote
/dis/sh
echo halt > /n/remote/dev/sysctl
unmount /n/remote
(remote script)
#!/dis/sh
load std
or {ftest -e /net/cs} {ndb/cs}
bind -c '#U*' /n/local
bind -a '#C' /
bind '#|' /tmp/pipes
cat /tmp/pipes/data > /dev/hoststdout&
cat /dev/hoststdin > /tmp/pipes/data&
export / <>/tmp/pipes/data1 >[2] /dev/null
echo halt > /dev/sysctl



The problem is that if I terminate the local inferno, the remote emu still runs. &nbsp;I'm not sure how to catch and clean that up gracefully....

1 comment:

caerwyn said...

If the remote is not closing, then maybe If either of the cat commands fail in the remote script then they should halt the system.

Not tried this but maybe,
{cat /tmp/pipes/data > /dev/hoststdout; echo halt > /dev/sysctl} &