Created Systemd (markdown)

oooo-ps 2025-07-08 23:30:29 +03:00
parent 7ab1dbcb18
commit b987b0c3b6

34
Systemd.md Normal file

@ -0,0 +1,34 @@
Run `aquatic-crawler` as `systemd` service.
## System user
To prevent permission issues, it is recommended to run the crawler under the same user as the [aquatic](https://github.com/greatest-ape/aquatic) service. Alternatively, you can change the group permissions and replace the `User` and `Group` below with your own values.
## Service configuration
Create new file `/etc/systemd/system/aquatic-crawler.service` with following settings:
``` snac.service
[Unit]
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=aquatic
Group=aquatic
ExecStartPre=/bin/sleep 10
ExecStart=/usr/local/bin/aquatic-crawler --infohash=/path/to/ipv6hash.bin --infohash=/path/to/ipv4hash.bin --tracker=udp://host1:port --export-rss=/path/to/rss.xml --export-trackers --enable-tcp
StandardOutput=file:/home/aquatic/crawler-debug.log
StandardError=file:/home/aquatic/crawler-error.log
[Install]
WantedBy=multi-user.target
```
* to disable errors output, set `StandardError` as `null`
### Manage
* `sudo systemctl daemon-reload` - apply new configuration
* `sudo systemctl enable aquatic-crawler` - autostart on system startup
* `sudo systemctl restart aquatic-crawler` - start the service