Merge pull request #8 from smart-facility/dev

PM2 process manager
pull/1/head
Piero Toffanin 2016-08-02 10:11:24 -05:00 zatwierdzone przez GitHub
commit 3a45bac30a
2 zmienionych plików z 28 dodań i 0 usunięć

Wyświetl plik

@ -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).

6
processes.json 100644
Wyświetl plik

@ -0,0 +1,6 @@
[{
"script" : "index.js",
"name" : "node-OpenDroneMap",
"watch" : false,
"ignore_watch" : ["[\\/\\\\]\\./", "node_modules", "git-hooks", "test", "tmp", "data", "twitter-reply-test", "twitter-send-test", "^.*\.log$"]
}]