Search code examples
erlangdaemonrpcerlang-otpmnesia

running mnesia node with its business logic as an OS deamon


I have developed an application which i have been running in the erlang shell by following this order.

$erl -name nodename@192.168.0.1 -mnesia dir '"/home/app/logic/database"' -setcookie  cookie

nodename@192.168.0.1> cd("/home/app/logic"). 

nodename@192.168.0.1> c(module1).

nodename@192.168.0.1> c(module2).

nodename@192.168.0.1> c(module3).

nodename@192.168.0.1> application:start(mnesia).

nodename@192.168.0.1>

Now my problem is that i want to run this application a daemon such that when i exit the erlang shell it continues running and communication with other nodes through rpc:call/4.


Solution

  • Kindly look at the erl command options, you should see something like -detached which would help you doing this. http://erlang.org/doc/man/erl.html