Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7773589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:10:00+00:00 2026-06-01T17:10:00+00:00

My web app has 3 main node.js components: website, feeds and jobs. To start

  • 0

My web app has 3 main node.js components: website, feeds and jobs.

To start these I am using forever:

//forever.js

var forever = require('forever');

function start(name){

  forever.start( ['coffee', name + '.coffee'], { /* log options */ } )

};

start('website');
start('feeds');
start('jobs');

What I first noticed is that if I run script it wont run it as a daemon. ( Which is most likely normal )

node forever.js

So what I did next was run the forever.js script with forever. I am not sure if this is correct, there is also a forever.startDaemon so not sure which one I should use.

forever start forever.js

This works but the problem is that I would like to restart all the processes when a new version of my app is published. I am using git’s post-receive hook to run the forever.js the first time but if I do this on each post-recieve it will just spawn 3 processes each time.

So I guess I need a way to restart 3 processes if they are already running. I thought to do this with forever.list but the documentation only say:

forever.list (format, callback)

Returns a list of metadata objects about each process that is being run using 
forever. This method is synchronous and will return the list of metadata as such.
Only processes which have invoked forever.startServer() will be available from
forever.list()

First of all I am not sure what format means and second it expects a callback but then it says its synchronous. Which is a little confusing and I am not sure how to use list.

In the end all I want to do is start/restart 3 node.js processes on git’s post-receive hook.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T17:10:01+00:00Added an answer on June 1, 2026 at 5:10 pm

    I think the best way to do this is:

    forever start website.js
    forever start feeds.js
    forever start jobs.js
    

    and then in your git post-receive hook:

    forever restart website.js
    forever restart feeds.js
    forever restart jobs.js
    

    Wrapping these node processes inside a single process is not a good idea. I now personally use Supervisord with monit instead of forever (supervisord is more stable & powerful than forever IMHO).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am implementing a web app using symfony 2. It has a main page
I'm writing a web app using php. The main file (index.php) has some Hebrew
I have two WARS: base-overlay example-app base-overlay has XML config files in src/main/webapp/WEB-INF/spring/*.xml .
My web app has been chugging along just great in Production for years with
I'm maintaining a web app that has performance problems. I want to record a
I have an existing web app that has a data layer and a bll
I have C# MVC web app that has some textboxes that in IE9 you
I'm developing a web app that has a database backend. In the past I'm
I'm building a new web app that has a requirement to generate an internal
I'm renovating an existing ASP.Net web-app which has a full-fledge functional SQL 2005 DB

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.