On Sun, Feb 19, 2012 at 12:19 PM, Diogo Resende
<[email protected]> wrote:
> On Sun, 19 Feb 2012 04:26:40 -0800 (PST), Angelo Chen wrote:
>>
>> a quick solution is, run the screen first.
>>
>> On Feb 19, 7:23 pm, jeeee <[email protected]> wrote:
>>>
>>> Hello,
>>>
>>> my node.js simple http server goes offline as soon as I logout of my
>>> ubuntu
>>> shell.
>>>
>>> How do I keep it alive 24/7?
>
>
> @Angelo Chen:
>
> Clearly the person in question does not understood what you said.
>
> @jeeee:
>
> When you ran your http server in your shell, it was attached to the
> shell. This is not node.js related. You have to find a way of running
> your server detached from your shell. One possible way is running
> screen program. Warning: this might get confusing

A good (temporary) solution:

    $ node server.js &
    $ disown %1
    $ exit

The `&` tells the shell to run node in the background. It will say
something like "[1] 1233," which means that the node process has pid
1233 and is job #1. Then, you disown the job and exit the shell. The
node process will continue to run in the background.
-- 
Ryan Doenges

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to