pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

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

Open Unitech opened this issue 12 years ago • 12 comments

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

Unitech avatar Jul 31 '14 08:07 Unitech

:+1:

soyuka avatar Jul 31 '14 17:07 soyuka

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

rlidwka avatar Aug 02 '14 02:08 rlidwka

Do you think that /var/opt could be the right folder to put PM2 configuration files ?

Unitech avatar Aug 04 '14 08:08 Unitech

+1

I'm hitting Error: EEXIST, file already exists '/root/.pm2' when running more than one app under pm2...

analytically avatar Aug 15 '14 19:08 analytically

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

steve-jansen avatar Aug 19 '14 00:08 steve-jansen

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).

drawsmcgraw avatar Aug 19 '14 16:08 drawsmcgraw

It will be for the 1.0

Unitech avatar Aug 22 '14 19:08 Unitech

What about using /etc/default/? Major distros use it, and I'd expect to find defaults there.

mspinassi avatar Oct 28 '14 03:10 mspinassi

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)

Unitech avatar Nov 10 '14 10:11 Unitech

Closing as solved with PM2_HOME env variable

Unitech avatar Nov 13 '14 00:11 Unitech

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.

mspinassi avatar Nov 13 '14 05:11 mspinassi

+1 for log files

sgarbesi avatar Jan 27 '16 07:01 sgarbesi