diff --git a/README.md b/README.md index 7131a40..b3d1c10 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/systemd/godns.service b/systemd/godns.service new file mode 100644 index 0000000..756e696 --- /dev/null +++ b/systemd/godns.service @@ -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