doc: add run-as-daemon.md (#25)

This commit is contained in:
Kevin Yu 2023-02-21 00:41:30 +08:00 committed by GitHub
parent f412f9eeac
commit 7bd18a343d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 50 additions and 2 deletions

View File

@ -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).

View File

@ -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
```