Project/Spitfire/Apps
There are several apps/scripts, running on our main Lab server (spitfire.initlab.org). They run as user apps.
To access them, login as root, and use the following command:
sudo -iu apps
Status monitoring and management
You can see the running apps using:
pm2 list
or see a log browser and live metrics using:
pm2 monit
These apps restart automatically on crash. In order to stop any of them, note its number in pm2 list, and issue the command:
pm2 stop 23 (where 23 is the ID of the app)
Then to start:
pm2 start 23
More info about PM2: https://pm2.keymetrics.io/docs/usage/quick-start/
If you want to check or manage the status the whole process manager (pm2), please use the systemd unit pm2-apps.service as root. It is responsible for starting the process manager and all apps on system boot.
systemctl start pm2-apps
systemctl stop pm2-apps
systemctl restart pm2-apps
systemctl status pm2-apps
Add a new app
As user apps:
- git clone URL-OF-APP
- cd DIR-OF-APP
- npm install
- create/adjust the app config, if necessary
- cd ..
- edit ecosystem.config.js, be careful about trailing commas
- pm2 reload ecosystem.config.js (this will start the new app, if properly added and configured)
- pm2 save (this will add the app to startup list)