Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Supervisord library for node.js
branch: master

This branch is 20 commits behind crcn:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
.gitignore
MIT-LICENSE.txt
README.md
package.json

README.md

What's this?

A node.js library for supervisord. If you're not familiar with supervisord, it's much like forever, launchd, upstart+monit, etc.

Requirements

  • Node.js
  • Supervisord
  • NPM

Installation

npm install supervisord

Example:

    var supervisord = require('supervisord');

    var client = supervisord.connect('http://localhost:9001');


    client.startProcess('my-app', function(err, result)
    {

    });

    //return all running processes by supervisord
    client.getAllProcessInfo(function(err, result)
    {
        console.log(result);

        /*
        [ { description: 'pid 22083, uptime 0:10:36',
        pid: 22083,
        stderr_logfile: '/tmp/test-stderr---supervisor-G27SFc.log',
        stop: 1316236587,
        logfile: '/tmp/test-stdout---supervisor-izrtu6.log',
        exitstatus: 0,
        spawnerr: '',
        now: 1316237455,
        group: 'app-1',
        name: 'app-1',
        statename: 'RUNNING',
        start: 1316236819,
        state: 20,
        stdout_logfile: '/tmp/test-stdout---supervisor-izrtu6.log' } ]
        */
    });

Available Methods:

  • getSupervisorVersion()
  • getIdentification()
  • getState()
  • getPID()
  • readLog()
  • clearLog()
  • shutdown()
  • restart()
  • getAllProcessInfo(name)
  • startProcess(name)
  • startAllProcesses()
  • startProcessGroup()
  • stopProcessGroup()
  • sendProcessStdin()
  • sendRemoteCommEvent()
  • addProcessGroup(name)
  • removeProcessGroup(name)
  • readProcessStdoutLog(name)
  • readProcessStderrLog(name, offset, length)
  • tailProcessStdoutLog(name, offset, length)
  • tailProcessStderrLog(name, offset, length)
  • clearProcessLogs(name)
  • clearAllProcesssLogs()
Something went wrong with that request. Please try again.