Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pm2 not using env variable from custom_options.sh #326

Closed
dewey opened this issue Feb 27, 2014 · 2 comments
Closed

pm2 not using env variable from custom_options.sh #326

dewey opened this issue Feb 27, 2014 · 2 comments

Comments

@dewey
Copy link

dewey commented Feb 27, 2014

I'm using debian and my custom_options.sh looks like this:

export DAEMON_RPC_PORT=6668
export DAEMON_PUB_PORT=6669

I'm using bitlbee which is running on port 6667, that's the reason why I set different values in the custom_options.sh to override the default port.

tcp6       0      0 :::6667                 :::*                    LISTEN      7987/bitlbee

But pm2 list is still failing if bitlbee is running:

{ online: true, success: true, pid: 8578 }

events.js:72
        throw er; // Unhandled 'error' event
          ^
Error: listen EADDRINUSE
    at errnoException (net.js:904:11)
    at Server._listen2 (net.js:1042:14)
    at listen (net.js:1064:10)
    at net.js:1146:9
    at asyncCallback (dns.js:68:16)
    at Object.onanswer [as oncomplete] (dns.js:121:9)

How can I tell pm2 to use the custom_options file and not use the default ports?

Thanks!

@Unitech
Copy link
Owner

Unitech commented Mar 6, 2014

Once you've modified the custom_option file, do a pm2 kill to kill the daemon. So the next time pm2 will take the options in account.
Reopen the issue if you had any problem

@Unitech Unitech closed this as completed Mar 6, 2014
@ghost
Copy link

ghost commented Dec 24, 2015

@Unitech
I met the same issue with PM2 0.15.10

  1. Edit PM2_KILL_TIMEOUT in custom_option.sh like this:
export PM2_KILL_TIMEOUT=10000000
  1. In term run
pm2 kill
  1. In term run
pm2 start app.json
  1. In term run
pm2 restart all

get:

[PM2][ERROR] Process 0 not found

PM2: 2015-12-24 16:23:21: Process with pid 23379 still not killed, retrying...
PM2: 2015-12-24 16:23:21: Process with pid 23379 still alive after 1600ms, sending it SIGKILL now...
PM2: 2015-12-24 16:23:21: Process cannot be killed kill ESRCH
PM2: 2015-12-24 16:23:21: Process with pid 23379 still not killed, retrying...
PM2: 2015-12-24 16:23:21: Process with pid 23379 still not killed, retrying...
PM2: 2015-12-24 16:23:21: Process with pid 23379 still not killed, retrying...
PM2: 2015-12-24 16:23:21: Process with pid 23379 still not killed, retrying...
PM2: 2015-12-24 16:23:22: Process with pid 23379 still not killed, retrying...
PM2: 2015-12-24 16:23:22: Process with pid 23379 still not killed, retrying...
PM2: 2015-12-24 16:23:22: Process with pid 23379 still not killed, retrying...
PM2: 2015-12-24 16:23:22: Process with pid 23379 still not killed, retrying...
PM2: 2015-12-24 16:23:22: Process with pid 23379 still not killed, retrying...
PM2: 2015-12-24 16:23:22: Process with pid 23379 still not killed, retrying...
PM2: 2015-12-24 16:23:22: Process with pid 23379 still not killed, retrying...
PM2: 2015-12-24 16:23:22: Process with pid 23379 still not killed, retrying...
PM2: 2015-12-24 16:23:22: Process with pid 23379 still not killed, retrying...
PM2: 2015-12-24 16:23:23: Process with pid 23379 still not killed, retrying...
PM2: 2015-12-24 16:23:23: Process with pid 23379 still not killed, retrying...
PM2: 2015-12-24 16:23:23: Process with pid 23379 could not be killed
PM2: 2015-12-24 16:23:23: Process with pid 23379 already exists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants