add systemd example, minor corrections

This commit is contained in:
yggverse 2026-04-06 23:18:38 +03:00
parent 9b0f438932
commit e9a3eda164

View file

@ -1,8 +1,8 @@
# ytd
YouTube daemon for crawling and processing channels with pre-configured commands
YouTube daemon and CLI tool for crawling and processing channels with pre-configured commands vector.
* this tool initially created as a tool for the [Pidpilne](https://codeberg.org/YGGverse/pidpilne) project.
_This tool initially created as a tool for the [Pidpilne](https://codeberg.org/YGGverse/pidpilne) project._
## Install
@ -22,4 +22,45 @@ Background / daemon:
``` bash
RUST_LOG=ytd=warn NO_COLOR=1 /usr/local/bin/ytd -c /etc/config.toml
```
```
### systemd
``` bash
git clone https://codeberg.org/yggverse/ytd.git
cd ytd
cargo build --release --locked
sudo install target/release/ytd /usr/local/bin
sudo cp example/config.toml /etc/ytd.toml
sudo useradd -s /usr/sbin/nologin -Mr ytd
sudo mkdir /var/lib/ytd && sudo chown ytd:ytd /var/lib/ytd
sudo mkdir /var/log/ytd && sudo chown ytd:ytd /var/log/ytd
```
``` /etc/systemd/system/ytd.service
#/etc/systemd/system/ytd.service
[Unit]
After=network-online.target
Wants=network-online.target
[Service]
User=ytd
Group=ytd
Environment="RUST_LOG=ytd=warn"
Environment="NO_COLOR=1"
WorkingDirectory=/var/lib/ytd
ExecStart=/usr/local/bin/ytd -c=/etc/ytd.toml
Restart=always
StandardOutput=file:///var/log/ytd/debug.log
StandardError=file:///var/log/ytd/error.log
[Install]
WantedBy=multi-user.target
```
* `sudo systemctl restart ytd`
* `sudo systemctl enable ytd`
* `sudo systemctl status ytd`