[erlang-questions] Starting Erlang as a Unix daemon

Sam Bobroff samb@REDACTED
Wed Jan 7 07:53:01 CET 2009


Hello everyone,

I'm working on a project in Erlang that needs to run as a daemon on a
Unix machine. I would like to provide feedback from the init script
that starts the daemon but I'm having trouble finding a good way of
doing it. For example, I would like this to happen from the shell:

# /etc/init.d/foo start
Starting foo... OK

or 

# /etc/init.d/foo start
Starting foo... FAILED

(If there was a fatal error during startup.)

I've tried using both "run_erl" and "erl -detached" but both of them
seem to fork and exit before any user code is run.

Does anyone know a good way to handle this?

Thanks in advance,
Sam.
-- 
Sam Bobroff | sam@REDACTED | M5 Networks



More information about the erlang-questions mailing list