I have a basic web server that I generated from the mochiweb framework. To start it I use the start.sh
script that the framework automatically generates. Everything works fine and the server starts up. Now I have one more mochiweb server that I want to start along with the first one. Again, this starts up perfectly standalone with its start.sh
script.
So what I did was create a script calling the start scripts of both the mochiweb servers from this script as background processes, something like:
serverOne/start.sh &
serverTwo/start.sh &
When I run the script, both servers seem to start normally, but immediately after they start, they seem to receive an EXIT signal and they shutdown. I have a feeling this is due to the operating system (ubuntu) terminating the processes that the main script file spawns to run the two start scripts. Or could there be any other reason? What should I do to solve this? How do I start the two servers with a single script file?
Right now the script file quits with the last line saying:
(nodeServer1@MyServ)1> *** Terminating erlang (nodeServer1@MyServ)
.
.
.
(nodeServer2@MyServ)1> *** Terminating erlang (nodeServer2@MyServ)