title: How to remove pm2 from startup (on mac)
body: <p>I experimenting with <a href="https://github.com/Unitech/PM2" rel="noreferrer">pm2</a>, which is a process manager for node.js applications. I tried their <a href="https://github.com/Unitech/PM2/blob/development/ADVANCED_README.md#startup-script" rel="noreferrer">pm2 startup</a> utility which generates and installs a startup script for pm2 when the system restarts. </p>
  
  <p>I tried this on my mac, and it works flawlessly. The pm2 automatically restarts and spawns up all my node scripts. </p>
  
  <p>However now, I am done experimenting and how do I remove this from my startup? I wish pm2 came with a similarly simple utility to uninstall itself from startup. </p>
  
  <p>I am aware that it is using <code>launchd</code> on mac to restart the process. I noticed that it installed a <code>io.keymetrics.PM2.plist</code> file under <code>/Users/&lt;username&gt;/Library/LaunchAgents</code> directory.</p>
  
  <p>Is it as simple as just deleting this file? or is it doing something more intrusive , and needs a more graceful uninstall? </p>
  
  <p>It internally uses the following command to install the startup script </p>
  
  <pre><code>   sudo env PATH=$PATH:/usr/local/bin pm2 startup darwin -u shaunak
  </code></pre>