Spawning erl from a C program

Joel Reymont joelr1@REDACTED
Sat Aug 19 19:29:54 CEST 2006


It turns out to be harder than I thought. I can connect to erl only  
if I launch it from the command line. I always get -3 from  
erl_connect when I spawn erl from my C program.

For some reason I cannot connect to the spawned node from another  
node either, although net_adm:ping/1 returns 'pong'. This is the  
spawned node:

6060  ??  S      0:00.14 /usr/local/lib/erlang/erts-5.5/bin/beam -- - 
root /usr/local/lib/erlang -progname erl -- -home /Users/joelr -sname  
cocoanode@REDACTED -noshell -noinput -setcookie foobarbaz -noshell - 
noinput

I then do this:

erl -setcookie foobarbaz -sname x@REDACTED
Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe]

Eshell V5.5  (abort with ^G)
(x@REDACTED)1>
User switch command
--> r 'cocoanode@REDACTED'
--> j
    1  {shell,start,[init]}
    2* {cocoanode@REDACTED,shell,start,[]}
--> c 2
*** ERROR: Shell process terminated! (^G to start new job) ***

and the result is clearly not what I'm expecting! I can ping the  
node, though:

User switch command
--> j
    1  {shell,start,[init]}
--> c 1

(x@REDACTED)2> net_adm:ping('cocoanode@REDACTED').
pang

Any clues?

	Thanks, Joel

--
http://wagerlabs.com/








More information about the erlang-questions mailing list