From 0165b5d368d853d8d38a394d0fbc1e57ac19566d Mon Sep 17 00:00:00 2001 From: Timothy Date: Thu, 23 Mar 2017 09:01:33 +0800 Subject: [PATCH] add systemd config file --- README.md | 10 ++++++++++ systemd/godns.service | 12 ++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 systemd/godns.service 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