Odd behavior with remote shells and command pipelines

Sam Bobroff <>
Thu Jul 30 07:37:38 CEST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi everyone,

I've noticed some odd behavior when using remote shells. Can anyone
explain why they happen, and if they are bugs or not?

The first thing is that it appears as if piping commands into erl causes
Erlang to use a different shell process. Here's an example:

In one terminal run:

    erl -sname bar

Then in another terminal compare running:

    erl -sname foo -remsh 

And typing 'node().' into the shell (I get '') to running this
on the command line:

    echo "node()." | erl -sname foo -remsh 

(I get '' and then "*** Terminating erlang ('')".)

The second odd thing is that by using a pipe and rpc:call to start a
remote shell it is possible to cause the remote node to shut down. For
example:

    echo | erl -sname foo -noshell -eval "rpc:call('', shell,
start, [])."

And the node "" will shut down. This still happens even if bar
is running restricted shells that do not allow q() or halt() to be
called. It does not happen when using "-remsh".

I'm using R13B01 on Ubuntu Linux.

Sam.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFKcTGim97/UHSa/AQRAunBAJ97VjEOcpqGeW2N4m7SrmRjEf5fUgCeJRP0
pQT1M0P270CQ1cWstwunaFY=
=OYLB
-----END PGP SIGNATURE-----


More information about the erlang-questions mailing list