Keeping Meteor running after exiting shell

3,442 views
Skip to first unread message

NP Derive

unread,
Feb 26, 2014, 7:00:39 PM2/26/14
to meteo...@googlegroups.com
I am still learning about Meteor, and have been playing around with it while reading DiscoverMeteor.com
 
I am having an issue that I can't figure out:
 
I can't seem to get Meteor to stay running after I exit out of my remote Linux terminal session (testing it on digitalocean) and making a file change or waiting long enough.   I've attempted to use nohup, disown, and the "&" option, but it looks like the Meteor app will run for a while, but as soon as I make an edit to a file in the app (for instance the main app.js file) and upload it via sftp, instead of doing a live update of the page as it would normally, it doesn't load anymore, causing me to log back in trough SSH and launching the app again.
 
It seems also, that if I simply wait long enough (overnight), it does the same thing.   I've tried the following commands from within the Meteor App directory:
 
1.
meteor --port 80 &
disown %1
 
2.
nohup meteor --port 80
 
 
 
Lastly, can I use a script or something to have the meteor app I want running to load after a reboot?
 
I am looking for an elegant solution, but anything will do at this point.
 
Many thanks.

Shawn Lim

unread,
Feb 26, 2014, 11:04:56 PM2/26/14
to meteo...@googlegroups.com
Hi I think https://github.com/arunoda/meteor-up/blob/master/README.md is the most elegant solution till date to deploy to your own server and keep the meteor app alive. You should check it out to see if it solves your problem
Message has been deleted

roman stachura

unread,
Feb 27, 2014, 3:18:26 PM2/27/14
to meteo...@googlegroups.com
quick and dirty... (probably more dirty... )

meteor run -p 80 --production  > /dev/null 2>&1
than hit -->  [Ctrl]+[z]
and send it to the background: --> type:  bg  and hit enter. 

But to be clear, if node dies, your meteor project will die too... there is no keep alive.

Valerio Santinelli

unread,
Feb 28, 2014, 4:55:00 AM2/28/14
to meteo...@googlegroups.com
I recommend you to use meteor deploy to actually deploy your app to your server instead of directly running the meteor command.

And then, for keeping it up, I usually run it with forever like this:

forever start -o stdout.log bundle/main.js

I hope this helps.

Valerio Santinelli

curiou...@gmail.com

unread,
Mar 1, 2014, 1:57:58 PM3/1/14
to meteo...@googlegroups.com
One easy solution for development use is to use tmux on your remote terminal. You can find more about it in this Ubuntu thread:

Abigail Watson

unread,
Mar 4, 2014, 12:20:28 PM3/4/14
to meteo...@googlegroups.com
If you're using Ubuntu/Debian, try using an upstart script:

It's the most elegant way I've found for running Meteor apps as a service.  

emgee3

unread,
Mar 4, 2014, 6:26:59 PM3/4/14
to meteo...@googlegroups.com
Just to be clear, `meteor --production` is still development mode. 
Reply all
Reply to author
Forward
0 new messages