Skip to content

Commit

Permalink
Add systemd service definition for ngrok
Browse files Browse the repository at this point in the history
I had been running ngrok in screen, but this is better. Now ngrok
comes up automatically on boot.
  • Loading branch information
mtraver committed May 27, 2019
1 parent 872b685 commit 23b159b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -272,6 +272,14 @@ and keep it running.
sudo systemctl start irremote.service
```

### Running ngrok

There is also a systemd service definition for ngrok in `config/systemd`. Follow the same steps
as above to install and enable it.

The service definition assumes that the ngrok binary is at `/usr/local/bin/ngrok`. Change the service
definition (both `ConditionPathExists` and `ExecStart`) if you'd like ngrok to live somewhere else.

## Appendix

### `Warning: Cannot access device: /dev/lirc0` on kernel 4.19
Expand Down
16 changes: 16 additions & 0 deletions config/systemd/ngrok.service
@@ -0,0 +1,16 @@
# /lib/systemd/system/ngrok.service
# sudo systemctl enable ngrok.service
[Unit]
Description=ngrok
ConditionPathExists=/usr/local/bin/ngrok

[Service]
Type=simple
Restart=always
RestartSec=2
User=pi
Group=pi
ExecStart=/usr/local/bin/ngrok start --all

[Install]
WantedBy=multi-user.target

0 comments on commit 23b159b

Please sign in to comment.