RomanSmoll
RomanSmoll

Reputation: 95

Modify the "exec cwd" path of the process -PM2

I have multiple processes that run on the server.

One process that was set up incorrectly. I had to make it work (without touching things that do) so for this process :

I would like to redirect the process from root to its own folder. It seems I can do it simply by modifying the exec cwd but I don't know how to do it.

Please help :) Cheers

Upvotes: 1

Views: 3567

Answers (1)

RomanSmoll
RomanSmoll

Reputation: 95

Ok well.

It seems it is impossible to modify it like this as this functionality is not implemented.

Therefore:

  • copy ecosystem and what you need from folder you are in to where you want it to run from
  • delete the process completely
  • do cd {path to your desired directory}
  • pm2 start ecosystem.config.js

//Additional if you want to keep the process old Id

  • pm2 kill (deletes all processes)
  • pm2 resurrect (restores them all with original id's)

Upvotes: 1

Related Questions