Making an Ubuntu daemon out of a release while using heart

Jim Morris wolfmanjm@REDACTED
Sat Mar 12 20:22:23 CET 2011


I wrote a blog entry on how I do it...

http://blog.wolfman.com/articles/2010/9/19/running-erlang-otp-applications-as-daemons-on-ubuntu-servers

Maybe not the easiest, but it works for me.

On Mar 9, 10:32 am, ori brost <oribr...@REDACTED> wrote:
> I have a release of a server program in Erlang that I would like to turn
> into a daemon. Currently I did this by writing a script (based on the
> release management script generated by rebar) which runs the Erlang VM
> synchronously, and writing an upstart .conf file which runs the script).
>
> My problem is that I want to use erl -heart. I have noticed that the
> whenever the VM dies, the heart process restarts it, but then the VM starts
> a new heart process and kills the old one. This means I have no permanent
> PIDs to follow. I was thinking of implementing my solution by having the
> script run a while-loop that will only exit if there is no heart process in
> the system (for now, assume there is no other erlang program running on the
> machine), and have upstart think that the script is the daemon.
>
> Does anyone have recommendation for a better solution? Or some general
> recommendation on how to make a daemon out of an Erlang server? Preferably
> using upstart?
>
> Best Regards,
>
> Ori Bar, Software Engineer
> Nivertech Ltd
>
> email:    ori....@REDACTED


More information about the erlang-questions mailing list