Coder Social home page Coder Social logo

pm2-interface's Introduction

pm2-interface's People

Contributors

achingbrain avatar bpostlethwaite avatar bretcope avatar jmingov avatar unitech avatar yannickcr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pm2-interface's Issues

Catching bus messages

Hy, I tried broadcasting a message as you say in your example

process.emit({ type : 'my:message', data : {}})

but the

ipm2.bus.on('*', function(event, data){ .... } );

does not catch it.

I issued "pm2 logs" and triggered the broadcast, and theres nothing in the logs

Edit:
I launched the application with "pm2 start entry.js -i 2"

Code hangs with node 0.10.30 release

This is a reduced case from a larger piece of code that hangs with 100% cpu usage by node when pm2 is not installed. The setInterval runs once (usually) and then things hang up at 100% cpu. If pm2 is installed, the code does not hang or if node 0.10.29 and earlier are used it does not hang.

var ipm2 = require('pm2-interface')();
var interval = setInterval( function () {
        console.log("FIRED");
    }, 500);

I'm not deliberately trying to use pm2-interface when pm2 is not installed but my code is auto-detecting to see if pm2 is being used or cluster2 module. The ipm2 line is at the top of the module and is unconditionally executed so I can avoid the problem by moving the line so the execution only happens if pm2 is around. Nevertheless, I wanted to report this because I don't know what changed in node 0.10.30 and whatever did it may pop up in other circumstances. I will also report it to the node issues.

Why "You shouldn't use this module"?

Why "You shouldn't use this module"? I think it's a very useful module for me to monitor my processes and catch notifications.
And I didn't find a way to send notifications between processes using pm2 module in your suggestion.
(and also it's small enough)

Add pm2 version RPC method

Is there any chance of getting a method that returns the version of pm2 a given instance of pm2-interface is connected to? It'd be quite useful to prompt users to upgrade pm2 when new features are added.

Add authentication

Right now, any client can connect to pm2-interface, invoke RPCs and receive events.

Some sort of authentication mechanism is necessary in order to prevent rogue clients wreaking havoc on production systems.

Either public keys, passwords over SSL, encrypted tokens or similar would do the trick.

Or should this go into axon/axon-rpc instead?

Update code?

The version of pm2-interface on npm is 1.1.0 yet the version in the repository is 0.1.3 - could you please push the new code to the repo so we can easily see what has changed?

there is no RELOAD function

full rpc object trace:

 rpc: 
  { prepare: [Function],
    prepareJson: [Function],
    getMonitorData: [Function],
    getSystemData: [Function],
    startProcessId: [Function],
    stopProcessId: [Function],
    stopProcessName: [Function],
    stopAll: [Function],
    softReloadProcessId: [Function],
    reloadProcessId: [Function],
    killMe: [Function],
    findByScript: [Function],
    findByPort: [Function],
    findByFullPath: [Function],
    restartProcessId: [Function],
    restartProcessName: [Function],
    deleteProcessName: [Function],
    deleteProcessId: [Function],
    msgProcess: [Function],
    deleteAll: [Function],
    ping: [Function],
    sendSignalToProcessId: [Function],
    sendSignalToProcessName: [Function],
    getVersion: [Function],
    reloadLogs: [Function],
    stopWatch: [Function],
    restartWatch: [Function] },

'ready' event never fires

I'm trying some very basic, and form some reason the 'ready' event never fires. I have no idea what the deal is and there are no errors in the logs. How can I find out what's going on?

# pm2 start test.js
Starting PM2 daemon...
[PM2] Process test.js launched
┌──────────┬────┬──────┬──────┬────────┬───────────┬────────┬─────────────┬─────────────┐
│ App name │ id │ mode │ PID  │ status │ restarted │ uptime │      memory │    watching │
├──────────┼────┼──────┼──────┼────────┼───────────┼────────┼─────────────┼─────────────┤
│ test     │ 0  │ fork │ 9236 │ online │         0 │ 0s     │ 15.273 MB   │ unactivated │
└──────────┴────┴──────┴──────┴────────┴───────────┴────────┴─────────────┴─────────────┘
 Use `pm2 desc[ribe] <id>` to get more details
# pm2 logs
########### Starting streaming logs for [all] process
[PM2] is being killed via kill method
[PM2] killing PM2 via Satan
[PM2] RPC socket closed
[PM2] PUB socket closed
[PM2] exiting PM2
[PM2] [[[[ PM2/God daemon launched ]]]]
[PM2] RPC interface [READY] on port 6666
[PM2] BUS system [READY] on port 6667
[PM2] Starting execution sequence in -fork mode- for app name:app id:0
[PM2] App name:app id:0 online
[PM2] App name:app id:0 exited
[PM2] Process with pid 5001 killed
[PM2] PM2 is being killed via kill method
[PM2] killing PM2 via Satan
[PM2] RPC socket closed
[PM2] PUB socket closed
[PM2] exiting PM2
[PM2] [[[[ PM2/God daemon launched ]]]]
[PM2] RPC interface [READY] on port 6666
[PM2] BUS system [READY] on port 6667
[PM2] Starting execution sequence in -fork mode- for app name:test id:0
[PM2] App name:test id:0 online
[PM2] App name:test id:0 exited
[PM2] Process with pid 9201 killed
[PM2] PM2 is being killed via kill method
[PM2] killing PM2 via Satan
[PM2] RPC socket closed
[PM2] PUB socket closed
[PM2] exiting PM2
[PM2] [[[[ PM2/God daemon launched ]]]]
[PM2] RPC interface [READY] on port 6666
[PM2] BUS system [READY] on port 6667
[PM2] Starting execution sequence in -fork mode- for app name:test id:0
[PM2] App name:test id:0 online
[test-0 (out)] starting
# cat test.js
var ipm2 = require('pm2-interface')();
console.log('starting');
ipm2.on('ready', function() { console.log('started'); });

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.