From 7bd18a343dbc039f0fa5144aeed404a100da1336 Mon Sep 17 00:00:00 2001 From: Kevin Yu Date: Tue, 21 Feb 2023 00:41:30 +0800 Subject: [PATCH] doc: add run-as-daemon.md (#25) --- docs/getting-started/README.md | 14 ++++++++-- docs/getting-started/run-as-daemon.md | 38 +++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 docs/getting-started/run-as-daemon.md diff --git a/docs/getting-started/README.md b/docs/getting-started/README.md index aa911a2..bacf154 100644 --- a/docs/getting-started/README.md +++ b/docs/getting-started/README.md @@ -36,16 +36,24 @@ make GOFLAGS="-buildvcs=false" CC=clang ### Run +**Config Dir** + +```shell +mkdir -p /etc/dae +curl -L -o /etc/dae/config.dae https://github.com/v2rayA/dae/raw/main/example.dae +``` + **Runtime Dependencies** -Download [geoip.dat](https://github.com/v2ray/geoip/releases/latest) and [geosite.dat](https://github.com/v2fly/domain-list-community/releases/latest) to `/usr/local/share/dae/`. +For traffic splitting, Dae relies on the following data sources, [geoip.dat](https://github.com/v2ray/geoip/releases/latest) and [geosite.dat](https://github.com/v2fly/domain-list-community/releases/latest). -``` +```shell mkdir -p /usr/local/share/dae/ pushd /usr/local/share/dae/ curl -L -o geoip.dat https://github.com/v2ray/geoip/releases/latest/download/geoip.dat curl -L -o geosite.dat https://github.com/v2ray/domain-list-community/releases/latest/download/dlc.dat popd + ``` **Run** @@ -54,4 +62,6 @@ popd ./dae run -c example.dae ``` +Alternatively, you may run Dae as a daemon(systemd) service. Check out more details [HERE](./run-as-daemon.md). + See [example.dae](https://github.com/v2rayA/dae/blob/main/example.dae). diff --git a/docs/getting-started/run-as-daemon.md b/docs/getting-started/run-as-daemon.md new file mode 100644 index 0000000..3e9a4a3 --- /dev/null +++ b/docs/getting-started/run-as-daemon.md @@ -0,0 +1,38 @@ +# Run Dae as a Daemon Service + +[systemd](https://wiki.debian.org/systemd) allows you to create and manage services in extremely powerful and flexible ways. + +> **Note** +> If your distribution's service manager is provided by systemd. + +Dae can be running as a daemon(systemd) service so that it can run at boot. + +## Prerequisites + +> **Note** +> The config file is recommended to save under `/etc/dae` + +Download the sample config file + +```bash +mkdir -p /etc/dae +curl -L -o /etc/dae/config.dae https://github.com/v2rayA/dae/raw/main/example.dae +``` + +## Setup + +```bash +# download the sample systemd.service +sudo curl -L -o /etc/systemd/system/dae.service https://github.com/v2rayA/dae/raw/main/install/dae.service + +# reload and restart daemon to take effect +sudo systemctl daemon-reload +sudo systemctl enable dae --now +sudo systemctl status dae +``` + +## Check System Logs + +```bash +sudo journalctl -xefu dae +```