Closing Terminal window terminates SSH
-
Annd then it crashed and i couldnt get it started. Deleted it. Reinstalled and this came up
xxx@xxx:~# forever start app.js warn: --minUptime not set. Defaulting to: 1000ms warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms info: Forever processing file: app.js error: Cannot start forever error: script /root/app.js does not exist.
-
xxx@xxx:~# cd mynodebb root@motor:~/mynodebb# sudo forever start app.js warn: --minUptime not set. Defaulting to: 1000ms warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms info: Forever processing file: app.js
But it still won't run without the terminal window sitting open like this.
xxx@xxx:~/mynodebb# node app info: NodeBB v0.2.1 Copyright (C) 2013 DesignCreatePlay Inc. info: This program comes with ABSOLUTELY NO WARRANTY. info: This is free software, and you are welcome to redistribute it under certain conditions. info: info: Initializing NodeBB v0.2.1, on port 4567, using redis store at 127.0.0.1:6379. info: NodeBB instance bound to: Any address (0.0.0.0) info: No changes to client-side libraries -- skipping minification info: NodeBB Read
-
@kevin I'm not exactly sure what you're trying to do. When you run forever start app.js it starts a daemon running in the background. You don't have to run node app again, you can close the terminal, the forever process will take care of your NodeBB.
Also if you're logged in with root (which I'd not encourage) you don't have to use sudo, forever start app.js is fine.
-
-
@kevin could you paste your public/config.json content here? Maybe manually configuring the socket.address and socket.port values would help.
-
@BarveyHirdman I'll write it in
http://community.nodebb.org/topic/485/how-do-you-get-to-the-nginx-configuration#3081#3200
in just a sec. Thank you. -
Screen is also a nice alternative.
Install screen and then run from your nodebb dir:
screen -S "screen name" node app
Where "screen name" is the name you want to call the process.
ctrl+a+d
Will detach the screen
screen -R "screen name"
Will reattach the screen.
-
@julian If the screen session is still running then a
screen -ls
Will list the current running screen sessions and then you can just reattach that screen.
I used to use it all the time with Minecraft servers and I use it now with NodeBB in conjunction with supervisor. The only problem i was having with screen is that if the program running in screen crashes, say NodeBB, then the screen session will also terminate. I would then have to ssh back into the server to start it up again. I'm hoping Supervisor will fix this.