diff --git a/README.md b/README.md
index f8946487..48054b19 100644
--- a/README.md
+++ b/README.md
@@ -292,9 +292,10 @@ nodemon sends a kill signal to your application when it sees a file update. If y
The following example will listen once for the `SIGUSR2` signal (used by nodemon to restart), run the clean up process and then kill itself for nodemon to continue control:
```js
-process.once('SIGUSR2', function () {
+// important to use `on` and not `once` as nodemon can re-send the kill signal
+process.on('SIGUSR2', function () {
gracefulShutdown(function () {
- process.kill(process.pid, 'SIGUSR2');
+ process.kill(process.pid, 'SIGTERM');
});
});
```
@@ -374,7 +375,6 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
-
@@ -388,9 +388,6 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
-
-
-
@@ -398,21 +395,18 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
-
+
-
-
-
-
+
@@ -421,14 +415,10 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
-
-
-
-
@@ -443,14 +433,16 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
-
-
-
+
+
+
+
+
Please note that links to the sponsors above are not direct endorsements nor affiliated with any of contributors of the nodemon project.
diff --git a/faq.md b/faq.md
index 6209ccc7..f0425825 100644
--- a/faq.md
+++ b/faq.md
@@ -353,8 +353,10 @@ Your application will likely be running the old version code if you see that mes
A common cause for this is when graceful shutdowns are doing async tasks, i.e:
```
-process.once('SIGUSR2', async () => {
+// ensure this is `on` and not `once`
+process.on('SIGUSR2', async () => {
await db.disconnect()
+ process.kill(process.pid, 'SIGTERM');
})
```
diff --git a/lib/monitor/run.js b/lib/monitor/run.js
index e05041e4..52442033 100644
--- a/lib/monitor/run.js
+++ b/lib/monitor/run.js
@@ -64,7 +64,7 @@ function run(options) {
const binPath = process.cwd() + '/node_modules/.bin';
const spawnOptions = {
- env: Object.assign({}, process.env, options.execOptions.env, {
+ env: Object.assign({}, options.execOptions.env, process.env, {
PATH:
binPath +
path.delimiter +
diff --git a/website/index.html b/website/index.html
index 7c87dbef..f64cf861 100644
--- a/website/index.html
+++ b/website/index.html
@@ -67,7 +67,6 @@
-
@@ -81,9 +80,6 @@
-
-
-
@@ -91,21 +87,18 @@
-
-
-
-
-Please note that links to the sponsors above are not direct endorsements nor affiliated with any of contributors of the nodemon project.