23 Systemd
oooo-ps edited this page 2025-10-26 05:05:45 +02:00

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 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:

[Unit]
After=network.target
Wants=network.target

[Service]
Type=simple

User=aquatic
Group=aquatic

# Handling torrents with a large number of files
# * if you encounter issues such as: 
#   "Error opening '/path/to/file' in read/write mode."
# LimitNOFILE=65536

# Uncomment for debug
# Environment="RUST_LOG=trace"
# Environment="RUST_LOG=aquatic_crawler=trace"
# Environment="NO_COLOR=1"

# Uncomment if some service starting with delay
# ExecStartPre=/bin/sleep 60

ExecStart=/usr/local/bin/aquatic-crawler\
        --infohash=/path/to/aquatic/hash.bin\
        --tracker=udp://[302:68d0:f0d5:b88d::fdb]:6969\
        --preload=/home/btracker/aquatic-crawler/yggdrasil/preload\
        --preload-max-filesize=500000\
        --preload-max-filecount=10\
        --preload-regex=\.(png|gif|jpeg|jpg|webp|svg|log|nfo|txt)$
StandardOutput=file:///home/aquatic/crawler-debug.log
StandardError=file:///home/aquatic/crawler-error.log

[Install]
WantedBy=multi-user.target
  • this configuration:
    • generates an RSS feed to a public location using the hash.bin source
    • appends the --tracker value (also required for info-hash resolution) to the magnet links
  • to disable debug output, use --debug option or set StandardError|StandardOutput 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