How to use the forever-monitor.start function in forever-monitor

To help you get started, we’ve selected a few forever-monitor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github justinhelmer / universal-javascript-vue / bin / start-all-servers.js View on Github external
processes.server = new (forever.Monitor)(path.join(serverDirectory, 'index.js'), {
  max: 1,
  args: ['--color'],
  watch: true,
  watchIgnoreDotFiles: true,
  watchDirectory: serverDirectory
});

processes.server.on('watch:restart', function(info) {
  console.log('\n%s: detected change to %s', chalk.bold.green('(restart)'), chalk.cyan(info.stat));
});

console.log('------------------------------------------------');
console.log('Starting MongoDB...');

processes.db = forever.start(['mongod'], {
  max: 1,
  silent: true
});

processes.db.on('start', function () {
  console.log('MongoDB is ready on', chalk.cyan(mongo));

  console.log('------------------------------------------------');
  console.log('\nStarting Node server...');

  processes.server.start();
});

processes.db.on('exit', function () {
  if (processes.server.running) {
    processes.server.stop();
github garbados / quilter / bin / quilt.js View on Github external
promptForOptions(program, function (program) {
      var child = forever.start([
        process.execPath,
        path.resolve(__dirname, './quilt-init.js'), 
        path.resolve(program.mount),
        program.remote
      ], {
        max: Infinity,
        silent: !program.verbose,
        spinSleepTime: 60000,
        minUptime: 1000,
        killTree: true
      });

      child.on('restart', function () {
        console.log('Quilt died. Restarting...');
      });
github icezeros / ice-speedy / src / main / engine / aria2.js View on Github external
start() {
    const sh = this.getStartSh();
    logger.info('[==== ice-speedy ====] Engine start sh===>', sh);
    this.instance = forever.start(sh, {
      max: 10,
      parser: function(command, args) {
        return {
          command: command,
          args: args,
        };
      },
      silent: !is.dev(),
    });

    const { child } = this.instance;
    logger.info('[==== ice-speedy ====] Engine pid===>', child.pid);

    this.instance.on('error', err => {
      logger.info(`[==== ice-speedy ====] Engine error===> ${err}`);
    });
github azukiapp / azk / lib / azk / agent / unfsd.js View on Github external
$ctx.returnValue = defer((function(resolve, reject) {
                change_status("starting");
                $__0.child = forever.start(args, {
                  max: 5,
                  silent: true,
                  pidFile: config("paths:unfsd_pid")
                });
                $__0.child.on('start', (function() {
                  change_status("started", {
                    port: port,
                    file: file
                  });
                  resolve();
                }));
              }));
              $ctx.state = -2;
github walmartlabs / mock-server / lib / forever.js View on Github external
module.exports = function(app, secureApp) {
  var args = process.argv;
  var child

  args.splice(args.indexOf('--forever',1))

  child = forever.start(args, {
      max : 5
    });
};
github hugetiny / negibox / src-electron / main-process / core / Engine.js View on Github external
start () {
    const sh = this.getStartSh()
    logger.info('[negibox] Engine start sh===>', sh)
    this.instance = forever.start(sh, {
      max: 100,
      parser: function (command, args) {
        return {
          command: command,
          args: args
        }
      },
      silent: !process.env.DEV
    })

    const { child } = this.instance
    logger.info('[negibox] Engine pid===>', child.pid)

    this.instance.on('error', (err) => {
      logger.info(`[negibox] Engine error===> ${err}`)
    })
github azukiapp / azk / lib / azk / agent / balancer.js View on Github external
return defer((function(resolve, reject, notify) {
      var child = forever.start(cmd, {
        max: 1,
        silent: true,
        pidFile: pid
      });
      child.on('exit:code', (function() {
        reject();
        process.kill(process.pid);
      }));
      child.on('start', (function() {
        return resolve(child);
      }));
    }));
  },
github azukiapp / azk / src / agent / unfsd.js View on Github external
return defer((resolve) => {
        change_status("starting");
        this.child = forever.start(args, {
          max : 5,
          silent : true,
          pidFile: config("paths:unfsd_pid")
        });

        this.child.on('start', () => {
          change_status("started", { port: port, file: file });
          resolve();
        });
      });
    });
github agalwood / Motrix / src / main / core / Engine.js View on Github external
start () {
    const sh = this.getStartSh()
    logger.info('[Motrix] Engine start sh===>', sh)
    this.instance = forever.start(sh, {
      max: 100,
      parser: function (command, args) {
        return {
          command: command,
          args: args
        }
      },
      silent: !is.dev()
    })

    const { child } = this.instance
    logger.info('[Motrix] Engine pid===>', child.pid)

    this.instance.on('error', (err) => {
      logger.info(`[Motrix] Engine error===> ${err}`)
    })

forever-monitor

Core forever process monitor

MIT
Latest version published 4 years ago

Package Health Score

51 / 100
Full package analysis