diff --git a/Systemd.md b/Systemd.md new file mode 100644 index 0000000..f531a9f --- /dev/null +++ b/Systemd.md @@ -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 \ No newline at end of file