Skip to content

Commit c19d971

Browse files
committed
tidy up, update README
1 parent 3c2114d commit c19d971

File tree

9 files changed

+441
-21
lines changed

9 files changed

+441
-21
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,32 @@ app.listen(PORT, () => {
117117
...this way the Node process will behaviour in the correct manner in either
118118
situation.
119119

120+
__Status:__
121+
122+
You can also send some status string to __systemd__, which will append to the service's log.
123+
124+
```javascript
125+
const notify = require('sd-notify')
126+
127+
// ...
128+
129+
notify.sendStatus('send some status to systemd')
130+
131+
// ...
132+
```
133+
134+
...then, for example:
135+
136+
```
137+
$ journalctl -u node-status
138+
139+
...
140+
Apr 22 17:29:41 lenovo node[8275]: (8275) listening on 8000
141+
Apr 22 17:29:41 lenovo systemd[1]: Started Express Node.js.
142+
Apr 22 17:35:50 lenovo node[8275]: send some status to systemd
143+
...
144+
```
145+
120146
[npm-image]: https://img.shields.io/npm/v/sd-notify.svg
121147
[npm-url]: https://npmjs.org/package/sd-notify
122148
[license-image]: http://img.shields.io/npm/l/sd-notify.svg

examples/status/node-status.service

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[Unit]
2+
Description=Express Node.js
3+
4+
[Service]
5+
Type=simple
6+
ExecStart=/home/rory/.nvm/versions/node/v8.11.1/bin/node /home/rory/Projects/Personal/sd-notify/examples/status/server.js
7+
KillMode=process
8+
TimeoutStartSec=30
9+
Restart=always
10+
11+
[Install]
12+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)