title: Where does PM2 save information about the processes you run with it?
body: <p>So I've got a number of questions here, but first let me provide some background information.</p>
  
  <p>I'm developing a Discord bot with Node.js and using PM2 for process management. This is the tree structure of the home directory of the VPS I'm running it on:</p>
  
  <pre><code>root@discord-bot-vps:~# tree . -L 2
  .
  ├── bigbotupdate.sh
  ├── botupdate.sh
  ├── ecosystem.config.js
  └── fcfs-bot
      ├── db
      ├── index.js
      ├── node_modules
      ├── package.json
      ├── package-lock.json
      ├── README.md
      └── src
  </code></pre>
  
  <p>I initially started the bot with an ecosystem file, inside the <code>fcfs-bot</code> directory, which houses a git repository. The <code>ecosystem.config.js</code> file looked like this:</p>
  
  <pre><code>module.exports = {
    apps : [{
      name: 'FCFS-BOT',
      script: 'index.js',
      instances: 1,
      autorestart: true,
      watch: false,
      shutdown_with_message: true,
      kill_timeout : 3000,
      time: true,
      env: {
        NODE_ENV: 'production',
        FCFS_BOT_TOKEN: 'REDACTED'
      },
    }]
  };
  </code></pre>
  
  <p>I've since moved the <code>ecosystem.config.js</code> file into the home directory, but when starting the process with <code>pm2 start ecosystem.config.js</code> from the home directory, it still works. This is counter-intuitive to me, as I would think the reference to <code>index.js</code> for the script would no longer work as it's now in a sub directory relative to the <code>ecosystem.config.js</code>. However, things work normally.</p>
  
  <p>I tried testing some other things, including renaming <code>ecosystem.config.js</code>, and then starting the process with <code>pm2 start FCFS-BOT</code>. This also works, which confuses me as I was under the impression that an ecosystem file was necessary to provide environment variables to the process as described here: <a href="https://pm2.keymetrics.io/docs/usage/environment/" rel="nofollow noreferrer">https://pm2.keymetrics.io/docs/usage/environment/</a>.</p>
  
  <ol>
  <li>How does PM2 store this data, and where can I find it?</li>
  <li>Should I keep starting my app with <code>pm2 start ecosystem.config.js</code> -- that is, is there any risk of the environment variables being "forgotten"?</li>
  <li>If not, is there a better way to configure the environment variables for a PM2 app than creating an <code>ecosystem.config.js</code>, running it once from that, and then deleting <code>ecosystem.config.js</code>?</li>
  </ol>