From 1fffb80066adf922e3f7cc33708b94f9decad378 Mon Sep 17 00:00:00 2001 From: Wei Feng Date: Mon, 17 Jun 2024 15:10:07 +1000 Subject: [PATCH] docs: add "Run as Linux Service via Systemd" to README (#359) * docs: add "Run as Linux Service via Systemd" to README * fix: update config file anchor * chore: add a section on testing details * fix: web ui url --- README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/README.md b/README.md index bb92560..57d6d9c 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,49 @@ adguardhome-sync run adguardhome-sync run --cron "0 */2 * * *" ``` +### Run as Linux Service via Systemd + +> Verified on Ubuntu Linux 24.04 + +Assume you have downloaded the the `adguardhome-sync` binary to `/opt/adguardhome-sync`. + +Create systemd service file `/opt/adguardhome-sync/adguardhome-sync.service`: + +``` +[Unit] +Description = AdGuardHome Sync +After = network.target + +[Service] +ExecStart = /opt/adguardhome-sync/adguardhome-sync --config /opt/adguardhome-sync/adguardhome-sync.yaml run + +[Install] +WantedBy = multi-user.target + +``` + +Create a configuration file `/opt/adguardhome-sync/adguardhome-sync.yaml`, please follow [Config file](#config-file-1) section below for details. + +Install and enable service: + +```bash +sudo cp /opt/adguardhome-sync/adguardhome-sync.service /etc/systemd/system/ + +sudo systemctl enable adguardhome-sync.service + +sudo systemctl start adguardhome-sync.service + +``` + +Then you can check the status: + +```bash +sudo systemctl status adguardhome-sync.service + +``` + +If web UI has been enabled in configuration (default port is 8080), can also check the status via `http://:8080` + ## Run Windows ```bash