error_logger and sasl\

Vance Shipley vances@REDACTED
Tue Jun 7 00:24:25 CEST 2005


On Mon, Jun 06, 2005 at 05:47:56PM -0400, Serge Aleynikov wrote:
}  
}  I see that there's some overlap in functionality of how the emulator can 
}  be started in production.  Two ways are mentioned in the docs:
}  
}  1. erl -detached -heart ...
}  2. run_erl -daemon ...
  
The emulator itself is an executable named "beam".  We always run
it by calling the program named "erl" as it does a lot of stuff we
don't care to know about.  The "erl" program has a number of options 
to control how it behaves, some of which are useful in an embedded
system.  The "run_erl" program is a front end for "erl" which handles
some of the issues inherent in an embedded system.

So I think that there is no overlap, run_erl provides yet more 
functionality over erl.

}  I believe the second feature is superseded by ^G command in the erl 
}  shell, where it is possible to connect a shell to a remote node (or is 
}  to_erl still preferable because it can really get access to the same 
}  console that started the node?).
  
The group leader for a process defines where the "tty" output goes.
If you use run_erl it receives all of this and logs it as well as
allowing you to connect and use the real console.  I have no idea
what happens to the group leader when you run -detached.

}  I was a bit hesitant to use run_erl because I wasn't sure if it could be 
}  reliably combined with the -heart option of starting the emulator. 

I've not used heart yet.

}  Would it be safe to do something like this in production:
}  
}  HEART_COMMAND= \
}    run_erl -daemon pipe_dir/ log_dir "erl -heart [command_arguments]"

The way you would normally start an embeded system is with is with
~/lib/erlang/bin/start.  You may add -heart to the command line
options there:

$ROOTDIR/bin/run_erl -daemon /tmp/ $ROOTDIR/log "exec $ROOTDIR/bin/start_erl $ROOTDIR $RELDIR $START_ERL_DATA -heart heart_command"

}  In this case does the "erl" need to have any of the following: -detached 
}  -noshell?

No!  You definetly don't want those as you will be using the 
console shell.  You may want to use some of the other options
though:

$ROOTDIR/bin/run_erl -daemon /tmp/ $ROOTDIR/log "exec $ROOTDIR/bin/start_erl $ROOTDIR $RELDIR $START_ERL_DATA +A32 +Bi -sname embedded"

}  Upon examining a few projects (eddie, yaws, etc.) I saw that production 
}  systems are started using the "erl -detached ..." as opposed to run_erl 
}  method.  Is it because it's more portable (i.e. run_erl is Linux/Solaris 
}  specific)?
  
The embedded system stuff was originally only targeted for Solaris 
and as such other OS users had to come up with their own.  I assume
that is what happened with Eddie.  The situation today is much better,
the embedded tools work with Solaris, FreeBSD, OS X and that other
*nix.  With yaws I think it's to minimize the OTP dependence.

	-Vance




More information about the erlang-questions mailing list