# This is a sample instantiated unit file for starting the indexer
# https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/using_systemd_unit_files_to_customize_and_optimize_your_system/assembly_working-with-systemd-unit-files_working-with-systemd#con_working-with-instantiated-units_assembly_working-with-systemd-unit-files
# Intended as a system service, started at boot time, but running as the argument user name
# Copy to e.g. /etc/systemd/system or /usr/lib/systemd/system/ and instantiate with a username as argument:
#  sudo systemctl enable recollindex@myuser.service
[Unit]
Description=Recollindex indexing for %i
After=network-online.target
RequiresMountsFor=/home/%i

[Service]
Type=exec
Restart=on-failure
RestartSec=30
ExecStart=/usr/bin/recollindex -m -D -x -w 10 -c /home/%i/.recoll
User=%i
# CPU usage control examples. If you set this low, you probably also want to configure the
# recollindex multithreading parameters in recoll.conf. Use thrTCounts to limit the number of
# threads, or disable multithreading altogether with thrQSizes = -1 -1 -1
# CPUQuota=40% # the indexer will use no more than 40% of one CPU core.
# CPUQuota=100% # the indexer will use no more than 100% of one CPU core.
# CPUQuota=250% # the indexer will use no more than the capacity of two and half CPU cores.

[Install]
WantedBy=multi-user.target
