[Unit] Description=Koha background worker (default queue) for %i Documentation=man:koha-worker(8) PartOf=koha@%i.target Requires=koha-create-dirs@%i.service Before=koha@%i.target After=koha-create-dirs@%i.service StartLimitIntervalSec=60 StartLimitBurst=3 [Service] Type=simple User=%i-koha Group=%i-koha SyslogIdentifier=%i-koha-worker # Capture stdout/stderr to the same files the daemon(1) wrapper used under # SysV, so log locations are identical whichever init package is installed. StandardOutput=append:/var/log/koha/%i/worker-output.log StandardError=append:/var/log/koha/%i/worker-error.log WorkingDirectory=/var/lib/koha/%i Environment=KOHA_CONF=/etc/koha/sites/%i/koha-conf.xml Environment=KOHA_HOME=/usr/share/koha Environment=PERL5LIB=/usr/share/koha/lib ExecStart=/usr/share/koha/bin/workers/background_jobs_worker.pl --queue default ProtectSystem=full ProtectHome=yes PrivateTmp=yes NoNewPrivileges=yes # The worker forks a child per job: signal only the parent and give running # jobs a chance to finish before the remaining processes are killed. KillMode=mixed TimeoutStopSec=120s Restart=on-failure RestartSec=5s [Install] WantedBy=koha@%i.target