1
0
mirror of https://github.com/taigrr/godns synced 2025-01-18 04:03:25 -08:00

add systemd config file

This commit is contained in:
Timothy 2017-03-23 09:01:33 +08:00
parent 5f52bfb3f9
commit 0165b5d368
2 changed files with 22 additions and 0 deletions

View File

@ -54,6 +54,16 @@ nohup ./godns &
sudo start godns
```
## Run it as a daemon, manage it via Systemd
* Modify `./systemd/godns.service` and config it.
* Copy `./systemd/godns.service` to `/lib/systemd/system`
* Start it as a systemd service:
```bash
sudo systemctl start godns
```
## Run it in docker
Now godns supports to run in docker.

12
systemd/godns.service Normal file
View File

@ -0,0 +1,12 @@
[Unit]
Description=GoDNS Service
After=network.target
[Service]
ExecStart=/path/to/your/godns-dir/godns -c=/path/to/your/godns-dir/config.json
Restart=always
KillMode=process
RestartSec=2s
[Install]
WantedBy=multi-user.target