Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Forever with ssh
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  22 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
William Myers  
View profile  
 More options Oct 16 2012, 2:53 am
From: William Myers <meun...@gmail.com>
Date: Mon, 15 Oct 2012 23:53:18 -0700
Local: Tues, Oct 16 2012 2:53 am
Subject: Forever with ssh
Is that a way to run forever in an ssh connection so that it continues to run even after the connection has been severed?

Currently, I have only had success with $ nohup node app.js however I would like to use forever and thought that it could be used like a daemon tool to keep a process going.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chad Engler  
View profile  
 More options Oct 16 2012, 10:24 am
From: "Chad Engler" <Chad.Eng...@patlive.com>
Date: Tue, 16 Oct 2012 10:24:27 -0400
Local: Tues, Oct 16 2012 10:24 am
Subject: RE: [nodejs] Forever with ssh
Just use:

        > forever start <script>

And see what is running:

        > forever list

And stop a script:

        > forever stop <index_or_script_name>

-Chad


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rhasson  
View profile  
 More options Oct 16 2012, 11:21 am
From: rhasson <rhas...@gmail.com>
Date: Tue, 16 Oct 2012 08:21:48 -0700 (PDT)
Local: Tues, Oct 16 2012 11:21 am
Subject: Re: [nodejs] Forever with ssh

use "screen"


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Julian Lannigan  
View profile  
 More options Oct 16 2012, 11:33 am
From: Julian Lannigan <julian.lanni...@homes.com>
Date: Tue, 16 Oct 2012 11:33:05 -0400
Local: Tues, Oct 16 2012 11:33 am
Subject: Re: [nodejs] Forever with ssh

+1 for screen

some links:
http://www.rackaid.com/resources/linux-screen-tutorial-and-how-to/
http://www.gnu.org/software/screen/manual/screen.html

Julian Lannigan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Anand George  
View profile  
 More options Oct 16 2012, 11:37 am
From: Anand George <mranandgeo...@gmail.com>
Date: Tue, 16 Oct 2012 21:07:28 +0530
Local: Tues, Oct 16 2012 11:37 am
Subject: Re: [nodejs] Forever with ssh

nohup also seems a good option. Used with supervisor it also tracks code
changes.

nohup supervisor app.js &

All logs are sent to nohup.out in the current folder by default.

On Tue, Oct 16, 2012 at 9:03 PM, Julian Lannigan
<julian.lanni...@homes.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chad Engler  
View profile  
 More options Oct 16 2012, 11:53 am
From: "Chad Engler" <Chad.Eng...@patlive.com>
Date: Tue, 16 Oct 2012 11:53:12 -0400
Local: Tues, Oct 16 2012 11:53 am
Subject: RE: [nodejs] Forever with ssh

Forever daemonizes the processes, there is no need for screen. From the
README:

  actions:
    start               Start SCRIPT as a daemon
    stop                Stop the daemon SCRIPT
    stopall             Stop all running forever scripts
    restart             Restart the daemon SCRIPT
    restartall          Restart all running forever scripts
    list                List all running forever scripts

...

  [Daemon]
    The forever process will run as a daemon which will make the target
process start
    in the background. This is extremely useful for remote starting
simple node.js scripts
    without using nohup. It is recommended to run start with -o -l, &
-e.
    ex. forever start -l forever.log -o out.log -e err.log my-daemon.js
        forever stop my-daemon.js

(bold added by me). I use this in production and it works fine.

-Chad

From: nodejs@googlegroups.com [mailto:nodejs@googlegroups.com] On Behalf
Of rhasson
Sent: Tuesday, October 16, 2012 11:22 AM
To: nodejs@googlegroups.com
Subject: Re: [nodejs] Forever with ssh

use "screen"

On Tuesday, October 16, 2012 10:24:40 AM UTC-4, Chad Engler wrote:

Just use:

        > forever start <script>

And see what is running:

        > forever list

And stop a script:

        > forever stop <index_or_script_name>

-Chad


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chad Engler  
View profile  
 More options Oct 16 2012, 11:54 am
From: "Chad Engler" <Chad.Eng...@patlive.com>
Date: Tue, 16 Oct 2012 11:54:13 -0400
Local: Tues, Oct 16 2012 11:54 am
Subject: RE: [nodejs] Forever with ssh

Note we also use --pidFile so we can monitor the process with monit as
well.

-Chad

From: nodejs@googlegroups.com [mailto:nodejs@googlegroups.com] On Behalf
Of Chad Engler
Sent: Tuesday, October 16, 2012 11:53 AM
To: nodejs@googlegroups.com
Subject: RE: [nodejs] Forever with ssh

Forever daemonizes the processes, there is no need for screen. From the
README:

  actions:
    start               Start SCRIPT as a daemon
    stop                Stop the daemon SCRIPT
    stopall             Stop all running forever scripts
    restart             Restart the daemon SCRIPT
    restartall          Restart all running forever scripts
    list                List all running forever scripts

...

  [Daemon]
    The forever process will run as a daemon which will make the target
process start
    in the background. This is extremely useful for remote starting
simple node.js scripts
    without using nohup. It is recommended to run start with -o -l, &
-e.
    ex. forever start -l forever.log -o out.log -e err.log my-daemon.js
        forever stop my-daemon.js

(bold added by me). I use this in production and it works fine.

-Chad

From: nodejs@googlegroups.com [mailto:nodejs@googlegroups.com] On Behalf
Of rhasson
Sent: Tuesday, October 16, 2012 11:22 AM
To: nodejs@googlegroups.com
Subject: Re: [nodejs] Forever with ssh

use "screen"

On Tuesday, October 16, 2012 10:24:40 AM UTC-4, Chad Engler wrote:

Just use:

        > forever start <script>

And see what is running:

        > forever list

And stop a script:

        > forever stop <index_or_script_name>

-Chad


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Axel Kittenberger  
View profile  
 More options Oct 17 2012, 12:10 am
From: Axel Kittenberger <axk...@gmail.com>
Date: Wed, 17 Oct 2012 06:09:29 +0200
Local: Wed, Oct 17 2012 12:09 am
Subject: Re: [nodejs] Forever with ssh
+2 for screen. I also run my node.js daemon in a "screen".

On Tue, Oct 16, 2012 at 5:33 PM, Julian Lannigan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt  
View profile  
 More options Oct 17 2012, 9:33 am
From: Matt <hel...@gmail.com>
Date: Wed, 17 Oct 2012 09:32:48 -0400
Local: Wed, Oct 17 2012 9:32 am
Subject: Re: [nodejs] Forever with ssh

It does bother me a bit that people are running their node daemons in
"screen". Can I at least presume this isn't for production?

I highly recommend using runit - it restarts on failure and is very simple
to install and use, and handles logging (including timestamping and log
rotation), privilege dropping, and environment variable setting.

On Wed, Oct 17, 2012 at 12:09 AM, Axel Kittenberger <axk...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jimb Esser  
View profile  
 More options Oct 17 2012, 12:59 pm
From: Jimb Esser <wastel...@gmail.com>
Date: Wed, 17 Oct 2012 09:59:23 -0700 (PDT)
Local: Wed, Oct 17 2012 12:59 pm
Subject: Re: [nodejs] Forever with ssh

Is there a problem with running in "screen"?  I've very little actual Linux
experience, but we've been very happy with running ours in "screen", lets
us trivially get both the aspects of a daemon, automatic logging all output
to one stream, and be able to connect to it interactively when things need
to be debugged.  In general, we still need something like runit to actually
launch the screen'd node process, and re-launch it if it fails, but I don't
see why running in a screen would be bad (but am by no means an expert =).


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt  
View profile  
 More options Oct 17 2012, 2:29 pm
From: Matt <hel...@gmail.com>
Date: Wed, 17 Oct 2012 14:29:19 -0400
Local: Wed, Oct 17 2012 2:29 pm
Subject: Re: [nodejs] Forever with ssh

I'm no sysadmin, but I've created/worked on some extremely large systems
(thousands of machines) and nobody running anything in production
environments would ever use screen for keeping things running. It's just
not designed for that. It has horrendous potential scenarios for disaster
by people pressing the wrong keys. It doesn't deal with log rotation or
storage or timestamping. It doesn't deal with restarting failed processes.
It's designed for interactive use. It's in no way designed as a secure
keep-alive system for daemons.

Compare that to: http://smarden.org/runit/benefits.html

I think if you hired a sysadmin (at least one worth what you pay him) he
would replace your "screen" based system in a flash.

On the other hand, I do use screen for everything else, and have it
constantly logged in doing "tail -F" on all my logs, so I can instantly see
what's going on in real time and pause and scroll back those logs if I need
to. I just don't use it for keeping daemons running.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chad Engler  
View profile  
 More options Oct 17 2012, 3:53 pm
From: "Chad Engler" <Chad.Eng...@patlive.com>
Date: Wed, 17 Oct 2012 15:53:33 -0400
Local: Wed, Oct 17 2012 3:53 pm
Subject: RE: [nodejs] Forever with ssh

Screen is really for having multiple terminals open with only 1
connection, and for working in a space that doesn't get destroyed if you
lose your connection. It isn't designed to keep a process running in a
production environment. Upstart, monit, forever, and other solutions
are.

-Chad

From: nodejs@googlegroups.com [mailto:nodejs@googlegroups.com] On Behalf
Of Matt
Sent: Wednesday, October 17, 2012 2:29 PM
To: nodejs@googlegroups.com
Subject: Re: [nodejs] Forever with ssh

I'm no sysadmin, but I've created/worked on some extremely large systems
(thousands of machines) and nobody running anything in production
environments would ever use screen for keeping things running. It's just
not designed for that. It has horrendous potential scenarios for
disaster by people pressing the wrong keys. It doesn't deal with log
rotation or storage or timestamping. It doesn't deal with restarting
failed processes. It's designed for interactive use. It's in no way
designed as a secure keep-alive system for daemons.

Compare that to: http://smarden.org/runit/benefits.html

I think if you hired a sysadmin (at least one worth what you pay him) he
would replace your "screen" based system in a flash.

On the other hand, I do use screen for everything else, and have it
constantly logged in doing "tail -F" on all my logs, so I can instantly
see what's going on in real time and pause and scroll back those logs if
I need to. I just don't use it for keeping daemons running.

On Wed, Oct 17, 2012 at 12:59 PM, Jimb Esser <wastel...@gmail.com>
wrote:

Is there a problem with running in "screen"?  I've very little actual
Linux experience, but we've been very happy with running ours in
"screen", lets us trivially get both the aspects of a daemon, automatic
logging all output to one stream, and be able to connect to it
interactively when things need to be debugged.  In general, we still
need something like runit to actually launch the screen'd node process,
and re-launch it if it fails, but I don't see why running in a screen
would be bad (but am by no means an expert =).

On Wednesday, October 17, 2012 6:33:02 AM UTC-7, Matt Sergeant wrote:

        It does bother me a bit that people are running their node
daemons in "screen". Can I at least presume this isn't for production?

        I highly recommend using runit - it restarts on failure and is
very simple to install and use, and handles logging (including
timestamping and log rotation), privilege dropping, and environment
variable setting.

        On Wed, Oct 17, 2012 at 12:09 AM, Axel Kittenberger

<axk...@gmail.com> wrote:

                +2 for screen. I also run my node.js daemon in a
"screen".

                On Tue, Oct 16, 2012 at 5:33 PM, Julian Lannigan

                <julian....@homes.com> wrote:
                > +1 for screen
                >
                > some links:
                >
http://www.rackaid.com/resources/linux-screen-tutorial-and-how-to/
                > http://www.gnu.org/software/screen/manual/screen.html
                >
                > Julian Lannigan
                >
                >
                >
                >

                > On Tue, Oct 16, 2012 at 11:21 AM, rhasson

<rha...@gmail.com> wrote:

                >>
                >> use "screen"
                >>
                >>
                >> On Tuesday, October 16, 2012 10:24:40 AM UTC-4, Chad
Engler wrote:

                >>>
                >>> Just use:
                >>>
                >>>         > forever start <script>
                >>>
                >>> And see what is running:
                >>>
                >>>         > forever list
                >>>
                >>> And stop a script:
                >>>
                >>>         > forever stop <index_or_script_name>
                >>>
                >>> -Chad
                >>>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ico  
View profile  
 More options Oct 17 2012, 1:50 pm
From: ico <ico.b...@gmail.com>
Date: Wed, 17 Oct 2012 19:50:03 +0200
Local: Wed, Oct 17 2012 1:50 pm
Subject: Re: [nodejs] Forever with ssh

It probably depends on your needs.

Do you need to start your app after system reboot?
Do you need to monitor your app and restart it if it hangs?

And anyway, tmux is better than screen :).


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
William Myers  
View profile  
 More options Oct 17 2012, 9:04 pm
From: William Myers <meun...@gmail.com>
Date: Wed, 17 Oct 2012 18:04:13 -0700 (PDT)
Local: Wed, Oct 17 2012 9:04 pm
Subject: Re: Forever with ssh

Chad,

I would agree with you and that is what I expected forever start <script>
to do however when I disconnect ssh then forever is also exiting. With
another ssh connection I check the running of the application with ps aux
while I am simultaneously connect and after to confirm what I am seeing
online with the app.

Can you or someone else confirm this behavior? Otherwise, I will have to go
with 'screen' as a possible solution or see if I can get vm console access
to run forever in the 'actual' console.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt  
View profile  
 More options Oct 17 2012, 10:56 pm
From: Matt <hel...@gmail.com>
Date: Wed, 17 Oct 2012 22:56:28 -0400
Local: Wed, Oct 17 2012 10:56 pm
Subject: Re: [nodejs] Re: Forever with ssh

Why are you so hung up on using forever? It's written in node which means
it can't have safe locking, it is far from 100% proven and solid. Just use
something proven instead.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Hahn  
View profile  
 More options Oct 17 2012, 11:19 pm
From: Mark Hahn <m...@hahnca.com>
Date: Wed, 17 Oct 2012 20:18:20 -0700
Local: Wed, Oct 17 2012 11:18 pm
Subject: Re: [nodejs] Re: Forever with ssh

+1 for monit  --  I started using it recently and it was easy and
full-featured.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Clay Simmons  
View profile  
 More options Oct 18 2012, 9:39 am
From: Clay Simmons <clay.simm...@gmail.com>
Date: Thu, 18 Oct 2012 06:39:24 -0700 (PDT)
Local: Thurs, Oct 18 2012 9:39 am
Subject: Re: Forever with ssh

I like using upstart on Ubuntu to keep my node process running. Not sure if
this is considered bad form, but I've been using it in production for about
8 months without any issues.

https://gist.github.com/3911822

If you're using screen, not to keep your node processes running, but just
for doing things in the shell, I would recommend giving tmux a try.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Axel Kittenberger  
View profile  
 More options Oct 18 2012, 10:03 am
From: Axel Kittenberger <axk...@gmail.com>
Date: Thu, 18 Oct 2012 16:03:19 +0200
Local: Thurs, Oct 18 2012 10:03 am
Subject: Re: [nodejs] Forever with ssh
I use it for development and testing-semi-production. You are very
right there are far superior tools. If you take Williams question
literally "I started something manually through ssh, but when I closed
the connection it died". "screen" is the answer to exactly that
problem. Maybe its good to tell, "screen is a solution to the problem
you are seeing, but actually you want to take it beyond that", or
maybe its just that

Kind regards,
Axel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jacob Groundwater  
View profile  
 More options Oct 18 2012, 11:59 pm
From: Jacob Groundwater <groundwa...@gmail.com>
Date: Thu, 18 Oct 2012 20:59:08 -0700 (PDT)
Local: Thurs, Oct 18 2012 11:59 pm
Subject: Re: Forever with ssh

+1 for upstart - I think using the platform native tools is good form

It can also be complimented with
[start-stop-daemon](http://man.he.net/man8/start-stop-daemon) when required.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Caswell  
View profile  
 More options Oct 19 2012, 11:22 am
From: Tim Caswell <t...@creationix.com>
Date: Fri, 19 Oct 2012 10:21:56 -0500
Local: Fri, Oct 19 2012 11:21 am
Subject: Re: [nodejs] Re: Forever with ssh
I run all my sites using upstart.

http://creationix.com/
http://howtonode.org/
http://nodebits.org/
http://luvit.io/

The sites themselves are mostly static content, so I don't need
cluster or anything.  The auto-restart directive in upstart keeps them
running between crashes and server reboots perfectly.

On Thu, Oct 18, 2012 at 10:59 PM, Jacob Groundwater


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
William Myers  
View profile  
 More options Oct 19 2012, 9:09 pm
From: William Myers <meun...@gmail.com>
Date: Fri, 19 Oct 2012 18:09:14 -0700
Local: Fri, Oct 19 2012 9:09 pm
Subject: Re: [nodejs] Re: Forever with ssh
I appreciate everyone's great insight and I will go with upstart!

On Oct 19, 2012, at 8:21 AM, Tim Caswell <t...@creationix.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jacob Groundwater  
View profile  
 More options Oct 22 2012, 12:21 pm
From: Jacob Groundwater <ja...@nodefly.com>
Date: Mon, 22 Oct 2012 09:20:40 -0700
Local: Mon, Oct 22 2012 12:20 pm
Subject: Re: [nodejs] Re: Forever with ssh

I have been using Foreman to run my jobs locally which can also export
upstart jobs.

Foreman is a ruby gem however, so over the weekend I decided to port a Node
version of foreman. http://nodefly.github.com/node-foreman/

I will be adding to the module over the next few weeks, if anyone would
like to help field test it, it would be much appreciated. It can export
upstart jobs that are not foreman dependent, so that should lower the risk
of using it.

Thanks!

- Jacob Groundwater


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »