I recently encountered an error in which the Erlang application died, resulting in a log message that looked like this:
=INFO REPORT==== 11-Jun-2010::11:07:25 ===
application: myapp
exited: shutdown
type: temporary
I have no idea what caused this shutdown, but the real problem is that it did not restart. Instead, the now empty Erlang VM just sat there doing nothing.
Now, from my research, it looks like there are other βstart typesβ that you can provide to the application: βtransitionalβ and βpermanentβ.
If I run Supervisor in an application, I can say that it makes a certain process temporary or permanent, and it will automatically restart it for me. However, according to the documentation, if I make the application temporary or permanent, it does not restart it when it dies, but it also kills all other applications.
What I really want to do is somehow tell Erlang VM that a particular application should always work, and if it is omitted, restart it. Can this be done?
(I'm not talking about deploying a supervisor on top of my application because then it's trick 22: what if my dispatcher process works? I'm looking for some kind of API or setting that I can use for Erlang monitor and restart my application for me.)
Thank!