Unitech / pm2-interface

Deprecated
Other
90 stars 14 forks source link

'ready' event never fires #17

Open tgolen opened 10 years ago

tgolen commented 10 years ago

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'); });
gopig commented 10 years ago

@tgolen this works for me: var ipm2 = require('pm2-interface')({"bind_host":"localhost","rpc_port":6666,"sub_port":6667});