dae/docs/en/user-guide/run-as-daemon.md

69 lines
2.3 KiB
Markdown
Raw Normal View History

2023-02-25 01:55:17 +07:00
# Run dae as a Daemon Service
2023-02-20 23:41:30 +07:00
[systemd](https://wiki.debian.org/systemd) allows you to create and manage services in extremely powerful and flexible ways.
> **Note**: (Prerequisites) If your distribution's service manager is provided by systemd.
2023-02-20 23:41:30 +07:00
dae can run as a daemon (systemd) service so that it can run at boot.
2023-02-20 23:41:30 +07:00
## Prerequisites
### Optional Geo Data Files
2023-02-26 18:44:25 +07:00
For more convenient traffic split, dae relies on the following data sources, [geoip.dat](https://github.com/v2fly/geoip/releases/latest) and [geosite.dat](https://github.com/v2fly/domain-list-community/releases/latest).
2023-02-26 18:44:25 +07:00
```shell
mkdir -p /usr/local/share/dae/
pushd /usr/local/share/dae/
curl -L -o geoip.dat https://github.com/v2fly/geoip/releases/latest/download/geoip.dat
curl -L -o geosite.dat https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat
2023-02-26 18:44:25 +07:00
popd
```
### Configuration File
2023-02-26 18:44:25 +07:00
> **Note**: The config file is recommended to save under `/etc/dae`
2023-02-20 23:41:30 +07:00
2023-02-26 18:44:25 +07:00
Download the sample config file:
2023-02-20 23:41:30 +07:00
```bash
mkdir -p /etc/dae
2023-03-14 14:01:55 +07:00
curl -L -o /etc/dae/config.dae https://github.com/daeuniverse/dae/raw/main/example.dae
2023-02-20 23:41:30 +07:00
```
## Download pre-compiled binaries
Releases are available in <https://github.com/daeuniverse/daed/releases>
> **Note**: If you would like to get a taste of new features, there are nightly (latest) builds available. Most of the time, newly proposed changes will be included in `PRs` and will be exported as cross-platform executable binaries in builds (GitHub Action Workflow Build). Noted that newly introduced features are sometimes buggy, do it at your own risk. However, we still highly encourage you to check out our latest builds as it may help us further analyze features stability and resolve potential bugs accordingly.
Nightly builds are available in <https://github.com/daeuniverse/dae/actions/workflows/build-nightly.yml>
```bash
sudo chmod +x ./dae
sudo install -Dm755 dae /usr/bin/
# helper
dae [-h,--help]
# check version
dae version
```
2023-02-20 23:41:30 +07:00
## Setup
```bash
# download the sample systemd.service
2023-03-14 14:01:55 +07:00
sudo curl -L -o /etc/systemd/system/dae.service https://github.com/daeuniverse/dae/raw/main/install/dae.service
2023-02-20 23:41:30 +07:00
# 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
```