FAQ
Hi,

I have a working node application.
I am using screen to run the node application so that it stays alive.
My application also uses express and node-mysql to execute few mysql
queries.

I want a way so that whenever the node process stops a notification should
be sent
The notification can be anything like logging in a log file a simple text
saying server stopped.

I tried,
process.on('exit', function(){
  //notification logic here..
});

but this doesn`t work.

Any help will be appreciated.

Thank you.

--
--
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Vaibhav mande at Sep 26, 2013 at 8:05 am
    Forgot to mention. Also using socket.io
    On Thursday, 26 September 2013 13:33:54 UTC+5:30, vaibhav mande wrote:

    Hi,

    I have a working node application.
    I am using screen to run the node application so that it stays alive.
    My application also uses express and node-mysql to execute few mysql
    queries.

    I want a way so that whenever the node process stops a notification should
    be sent
    The notification can be anything like logging in a log file a simple text
    saying server stopped.

    I tried,
    process.on('exit', function(){
    //notification logic here..
    });

    but this doesn`t work.

    Any help will be appreciated.

    Thank you.
    --
    --
    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    ---
    You received this message because you are subscribed to the Google Groups "nodejs" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Greelgorke at Sep 26, 2013 at 9:02 am
    you could use forever, mon, upstart, up. check them :)

    Am Donnerstag, 26. September 2013 10:03:54 UTC+2 schrieb vaibhav mande:
    Hi,

    I have a working node application.
    I am using screen to run the node application so that it stays alive.
    My application also uses express and node-mysql to execute few mysql
    queries.

    I want a way so that whenever the node process stops a notification should
    be sent
    The notification can be anything like logging in a log file a simple text
    saying server stopped.

    I tried,
    process.on('exit', function(){
    //notification logic here..
    });

    but this doesn`t work.

    Any help will be appreciated.

    Thank you.
    --
    --
    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    ---
    You received this message because you are subscribed to the Google Groups "nodejs" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Vaibhav mande at Sep 26, 2013 at 9:28 am
    Thanks greelgorke.

    For some reasons I need to run node process in a screen only(cant use
    nohup, forever etc..).
    I dont think any of these modules will consider that screen session (while
    restarting a stopped node service).
    At any point my node service should be running in a screen session only!!!

    My current focus is a way to notify or may be send an email stating that
    the node service has stopped and needs a restart
    so that once I get that email I can attach to a particular screen session
    and restart the node service manually.

    Thanks for the reply
    Vaibhav Mande.
    On Thursday, 26 September 2013 14:32:52 UTC+5:30, greelgorke wrote:

    you could use forever, mon, upstart, up. check them :)

    Am Donnerstag, 26. September 2013 10:03:54 UTC+2 schrieb vaibhav mande:
    Hi,

    I have a working node application.
    I am using screen to run the node application so that it stays alive.
    My application also uses express and node-mysql to execute few mysql
    queries.

    I want a way so that whenever the node process stops a notification
    should be sent
    The notification can be anything like logging in a log file a simple text
    saying server stopped.

    I tried,
    process.on('exit', function(){
    //notification logic here..
    });

    but this doesn`t work.

    Any help will be appreciated.

    Thank you.
    --
    --
    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    ---
    You received this message because you are subscribed to the Google Groups "nodejs" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Greelgorke at Sep 26, 2013 at 1:43 pm
    simple way would be to have a master process which is monitoring the
    application processes. look at https://npmjs.org/package/up-time, it wraps
    your application.

    Am Donnerstag, 26. September 2013 11:27:59 UTC+2 schrieb vaibhav mande:
    Thanks greelgorke.

    For some reasons I need to run node process in a screen only(cant use
    nohup, forever etc..).
    I dont think any of these modules will consider that screen session (while
    restarting a stopped node service).
    At any point my node service should be running in a screen session only!!!

    My current focus is a way to notify or may be send an email stating that
    the node service has stopped and needs a restart
    so that once I get that email I can attach to a particular screen session
    and restart the node service manually.

    Thanks for the reply
    Vaibhav Mande.
    On Thursday, 26 September 2013 14:32:52 UTC+5:30, greelgorke wrote:

    you could use forever, mon, upstart, up. check them :)

    Am Donnerstag, 26. September 2013 10:03:54 UTC+2 schrieb vaibhav mande:
    Hi,

    I have a working node application.
    I am using screen to run the node application so that it stays alive.
    My application also uses express and node-mysql to execute few mysql
    queries.

    I want a way so that whenever the node process stops a notification
    should be sent
    The notification can be anything like logging in a log file a simple
    text saying server stopped.

    I tried,
    process.on('exit', function(){
    //notification logic here..
    });

    but this doesn`t work.

    Any help will be appreciated.

    Thank you.
    --
    --
    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    ---
    You received this message because you are subscribed to the Google Groups "nodejs" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Shawn Parrish at Sep 26, 2013 at 1:47 pm
    You may want to consider an external monitoring service... maybe
    something written in Node <grin>.

    We'll be releasing our new websocket/socket.io monitoring soon.

    Shawn

    http://nodeping.com
    On Thu, Sep 26, 2013 at 7:43 AM, greelgorke wrote:
    simple way would be to have a master process which is monitoring the
    application processes. look at https://npmjs.org/package/up-time, it wraps
    your application.

    Am Donnerstag, 26. September 2013 11:27:59 UTC+2 schrieb vaibhav mande:
    Thanks greelgorke.

    For some reasons I need to run node process in a screen only(cant use
    nohup, forever etc..).
    I dont think any of these modules will consider that screen session (while
    restarting a stopped node service).
    At any point my node service should be running in a screen session only!!!

    My current focus is a way to notify or may be send an email stating that
    the node service has stopped and needs a restart
    so that once I get that email I can attach to a particular screen session
    and restart the node service manually.

    Thanks for the reply
    Vaibhav Mande.
    On Thursday, 26 September 2013 14:32:52 UTC+5:30, greelgorke wrote:

    you could use forever, mon, upstart, up. check them :)

    Am Donnerstag, 26. September 2013 10:03:54 UTC+2 schrieb vaibhav mande:
    Hi,

    I have a working node application.
    I am using screen to run the node application so that it stays alive.
    My application also uses express and node-mysql to execute few mysql
    queries.

    I want a way so that whenever the node process stops a notification
    should be sent
    The notification can be anything like logging in a log file a simple
    text saying server stopped.

    I tried,
    process.on('exit', function(){
    //notification logic here..
    });

    but this doesn`t work.

    Any help will be appreciated.

    Thank you.
    --
    --
    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    ---
    You received this message because you are subscribed to the Google Groups
    "nodejs" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to nodejs+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    --
    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    ---
    You received this message because you are subscribed to the Google Groups "nodejs" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Greelgorke at Sep 26, 2013 at 3:07 pm
    yeah right, there are also several possibilities to do it from external
    service. there are a bunch of them, some do http piging, some of them
    provide you with a monitoring module like New Relic or StrongLoop. search
    engine is your friend

    Am Donnerstag, 26. September 2013 15:47:17 UTC+2 schrieb Shawn:
    You may want to consider an external monitoring service... maybe
    something written in Node <grin>.

    We'll be releasing our new websocket/socket.io monitoring soon.

    Shawn

    http://nodeping.com
    On Thu, Sep 26, 2013 at 7:43 AM, greelgorke wrote:
    simple way would be to have a master process which is monitoring the
    application processes. look at https://npmjs.org/package/up-time, it wraps
    your application.

    Am Donnerstag, 26. September 2013 11:27:59 UTC+2 schrieb vaibhav mande:
    Thanks greelgorke.

    For some reasons I need to run node process in a screen only(cant use
    nohup, forever etc..).
    I dont think any of these modules will consider that screen session
    (while
    restarting a stopped node service).
    At any point my node service should be running in a screen session
    only!!!
    My current focus is a way to notify or may be send an email stating
    that
    the node service has stopped and needs a restart
    so that once I get that email I can attach to a particular screen
    session
    and restart the node service manually.

    Thanks for the reply
    Vaibhav Mande.
    On Thursday, 26 September 2013 14:32:52 UTC+5:30, greelgorke wrote:

    you could use forever, mon, upstart, up. check them :)

    Am Donnerstag, 26. September 2013 10:03:54 UTC+2 schrieb vaibhav
    mande:
    Hi,

    I have a working node application.
    I am using screen to run the node application so that it stays alive.
    My application also uses express and node-mysql to execute few mysql
    queries.

    I want a way so that whenever the node process stops a notification
    should be sent
    The notification can be anything like logging in a log file a simple
    text saying server stopped.

    I tried,
    process.on('exit', function(){
    //notification logic here..
    });

    but this doesn`t work.

    Any help will be appreciated.

    Thank you.
    --
    --
    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 nod...@googlegroups.com<javascript:>
    To unsubscribe from this group, send email to
    nodejs+un...@googlegroups.com <javascript:>
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    ---
    You received this message because you are subscribed to the Google Groups
    "nodejs" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to nodejs+un...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    --
    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    ---
    You received this message because you are subscribed to the Google Groups "nodejs" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Matt at Sep 26, 2013 at 3:57 pm

    On Thu, Sep 26, 2013 at 5:27 AM, vaibhav mande wrote:

    For some reasons I need to run node process in a screen only(cant use
    nohup, forever etc..).
    Why?

    If it's just to see the logs, use screen doing tail -F on the log file.

    Trust me, using screen for keeping a service up is doing it wrong.

    --
    --
    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    ---
    You received this message because you are subscribed to the Google Groups "nodejs" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Vaibhav mande at Sep 27, 2013 at 5:37 am
    Thank you for all your help.
    I will try all your suggestions and will post the solution that worked for
    me.
    Thanks again.
    On Thursday, 26 September 2013 13:33:54 UTC+5:30, vaibhav mande wrote:

    Hi,

    I have a working node application.
    I am using screen to run the node application so that it stays alive.
    My application also uses express and node-mysql to execute few mysql
    queries.

    I want a way so that whenever the node process stops a notification should
    be sent
    The notification can be anything like logging in a log file a simple text
    saying server stopped.

    I tried,
    process.on('exit', function(){
    //notification logic here..
    });

    but this doesn`t work.

    Any help will be appreciated.

    Thank you.
    --
    --
    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 nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    ---
    You received this message because you are subscribed to the Google Groups "nodejs" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupnodejs @
categoriesnodejs
postedSep 26, '13 at 8:03a
activeSep 27, '13 at 5:37a
posts9
users4
websitenodejs.org
irc#node.js

People

Translate

site design / logo © 2022 Grokbase