diff --git a/README.md b/README.md index 9c35d15..6fb74ec 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,28 @@ npm install node index.js ``` +### Run it using PM2 + +The app can also be run as a background process using the [pm2 process manager](https://github.com/Unitech/pm2), which can also assist you with system startup scripts and process monitoring. + +To install pm2, run (using `sudo` if required): +```shell +npm install pm2 -g +``` +The app can then be started using +```shell +pm2 start processes.json +``` +To have pm2 started on OS startup run +```shell +pm2 save +pm2 startup +``` +and then run the command as per the instructions that prints out. If that command errors then you may have to specify the system (note that systemd should be used on CentOS 7). Note that if the process is not running as root (recommended) you will need to change `/etc/init.d/pm2-init.sh` to set `export PM2_HOME="/path/to/user/home/.pm2"`, as per [these instructions]( +http://www.buildsucceeded.com/2015/solved-pm2-startup-at-boot-time-centos-7-red-hat-linux/) + +You can monitor the process using `pm2 status`. + ### Test Images You can find some test drone images from [OpenDroneMap's Test Data Folder](https://github.com/OpenDroneMap/OpenDroneMap/tree/master/tests/test_data/images).