title: pm2 - Startup script for non-root user permission denied
body: <p>I just installed pm2 (on Debian 9) and I need to run NodeJS server of few users. Every user have own NodeJS server what I need to run under them. Not under root.</p>
  
  <p>For example I have user "user1":</p>
  
  <ul>
  <li>I can control pm2 normally</li>
  <li>This command on user1 for enabling startup scripts:
  <code>pm2 startup</code></li>
  <li>Then I copypaste outputed command to root and execute...</li>
  <li>Startup script for given user is now created</li>
  </ul>
  
  <p>pm2 still works on user1, but after restart I cannot control pm2 and Iam getting this error:
  <code>[PM2][ERROR] Permission denied, to give access to current user:
  $ sudo chown user1:user1 /home/user1/.pm2/rpc.sock /home/user1/.pm2/pub.sock
  </code></p>
  
  <p>If I execute this command on root, I can then again control pm2 on user1, but all NodeJS servers are executed as root!!</p>
  
  <p>I need to 'grant' permissions every restart..</p>
  
  <p>How to fix this?</p>