I have problems to understand how to run meteor as daemon.
I have built an application and I would like to run and release it in production on http://ip:port
Application works fine by meteor --production --port 3000 & and I can go around putty, but when I close it Meteor process dies.
I understand that Upstart would be a solution and I have seen that some Meteor developers has conf. files in /etc/init/
However, I cannot figure out how I could run meteor everytime server reboot or something - I have been spending one week straight on computer working with my application, so I feel I am having serious brainfog to understand certain things.
I have tried the following (/etc/init/myMeteorApplication.conf) running it by start myMeteorApplication and it looks that Ubuntu find the .conf file, but nothing really happens and cannot be found in service --status-all. Typing stop myMeteorApplication returns stop: Unknown instance:
/etc/init/myMeteorApplication.conf
start on runlevel [2345]
stop on runlevel [016]
respawn
pre-start script
cd myMeteorDir
echo ""
end script
exec meteor --help --production --port 3000
ps ax | grep meteor | grep -v grep will give you process id for your command. Then you can kill _processId_.
I do not understanding the difference between exiting from Putty and closing it.
You will not receive a Meteor starting log in Putty with /etc/init or /etc/init.d. Try the ps ax | grep meteor | grep -v grep command, if you get a process id, that means it is working.
Also, when using Putty, Ctrl+D out of your connections to make sure you don’t leave the server hanging (even if it’s a tiny little bit of time). At least that was the case when I was on Windows (years ago).