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

Ability to use environment variables with running process #541

Closed
krnekit opened this issue Jun 30, 2014 · 2 comments
Closed

Ability to use environment variables with running process #541

krnekit opened this issue Jun 30, 2014 · 2 comments

Comments

@krnekit
Copy link

krnekit commented Jun 30, 2014

It would be useful, if I can set environment variables not only before script start but when it already running. For example:

pm2 start processes.json
PM2_GRACEFUL_TIMEOUT=60000 pm2 gracefulRestart foobar

At the moment I can only specify it before starting script.

@soyuka
Copy link
Collaborator

soyuka commented Jun 30, 2014

Noticed, closing because it's likely the same issue as #528, you want to reload environment variables when restarting.

@soyuka soyuka closed this as completed Jun 30, 2014
@rlidwka
Copy link
Collaborator

rlidwka commented Jul 10, 2014

you want to reload environment variables when restarting

override old values with memory, not reload:

$ PM2_GRACEFUL_TIMEOUT=60000 pm2 gracefulRestart foobar
# it's 60k
$ pm2 gracefulRestart foobar
# still 60k
$ PM2_GRACEFUL_TIMEOUT=30000 pm2 gracefulRestart foobar
# 30k now
$ pm2 gracefulRestart foobar
# still 30k

Looks pretty doable.

PS: oh wait... pm2 doesn't see those overrides, it sees the entire environment. Oops... Yep, I don't know how to do this. Maybe merge environments somehow...

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

No branches or pull requests

3 participants