Following http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
PM2 configuration files will be located in /etc/pm2
Logs in /var/log
PID files in /var/run
PM2 dump file in /var/lib
:+1:
Maybe change it to $PM2_HOME/log, $PM2_HOME/run and $PM2_HOME/lib respectively. This way if someone wants to conform to FHS, he would just set PM2_HOME=/var
Do you think that /var/opt could be the right folder to put PM2 configuration files ?
+1
I'm hitting Error: EEXIST, file already exists '/root/.pm2' when running more than one app under pm2...
+1 to @rlidwka on $PM2_HOME
Use $PM2_HOME if it exists, otherwise default to /var/log/pm2, /var/run/pm2, and /var/lib/pm2. Using pm2 as a subdir may make it easier to chroot processes than just using '/var/run' and /var/log.
Ideally, I'd like config files to be optional, and have an optional global config in $PM2_HOME/lib or /etc/pm2, along with an optional user config in ~/.pm2.
I second @steve-jansen . Having default values, I think, would solve my issue with installing/using PM2 in Salt runs (as well as Chef/Puppet/Bamboo runs that I've also heard about).
It will be for the 1.0
What about using /etc/default/?
Major distros use it, and I'd expect to find defaults there.
Now you can override the PM2 configuration folder by changing PM2_HOME while starting pm2.
It works well with the new master branch (not published yet)
Closing as solved with PM2_HOME env variable
Thanks for the update @Unitech.
It would be great if we can also change logs and pidfiles dirs too, instead of bundling it in one directory and symlinking to other locations.
+1 for log files
Most helpful comment
+1 for log files