Pm2: Change location of configuration files/logs/pids... to standard file path for Unix like systems

Created on 31 Jul 2014  路  12Comments  路  Source: Unitech/pm2

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

Enhancement Question

Most helpful comment

+1 for log files

All 12 comments

:+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

Was this page helpful?
0 / 5 - 0 ratings