Skip to content

systemd service

On Linux operating systems, you may want to run TBBM PROZESSING using systemd timers.

  1. Install Python 3.14
  2. Add a service user prozessing
  3. Create /var/prozessing and make it writable for the user prozessing
  4. prozessing.pyz to /opt/PROZESSING/prozessing.pyz
  5. Install INI files to /opt/PROZESSING/ini/
  6. Install systemd service PROZESSING@.service (see below)
  7. For each INI file foobar.ini, create a PROZESSING@foobar.timer (see below) in /etc/systemd/system/
  8. For each INI file foobar.ini, run systemctl enable --now PROZESSING@foobar.timer

Helpful commands for the service and timers:

  • systemctl status PROZESSING@foobar.service – get status of the service
  • systemctl status PROZESSING@foobar.timer – get status of the timer
  • systemctl start --no-block PROZESSING@foobar.service – run service now
  • systemctl enable --now PROZESSING@foobar.service – enable and start the timer now
  • systemctl list-timers – list all timers

Systemd timers support a variety of timespans and calendar Events, see systemd.time for details.

ini
# /etc/systemd/system/PROZESSING@.service
[Unit]
Description=TBBM PROZESSING for %i
Documentation=https://prozessing.tbbm.at/

[Service]
Environment=LOGS_DIRECTORY=/var/prozessing/logs/
ExecStart=/usr/bin/python /opt/PROZESSING/prozessing.pyz ini/%i.ini
NoNewPrivileges=true
PrivateDevices=true
PrivateIPC=true
PrivateTmp=true
PrivateUsers=true
ProtectClock=true
ProtectControlGroups=true
ProtectHome=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectSystem=strict
ReadWritePaths=/var/prozessing/
Type=oneshot
User=prozessing
WorkingDirectory=/opt/PROZESSING/
ini
# /etc/systemd/system/PROZESSING@foobar.timer
[Unit]
Descrptions=foobar
Documentation=https://wiki.example.com/jobs/foobar

[Install]
WantedBy=timers.target

# run daily
[Timer]
OnCalendar=daily
Persistent=true
RandomizedDelaySec=10m

# run daily at 03:10:00
[Timer]
OnCalendar=*-*-* 03:10:00
Persistent=true
RandomizedDelaySec=30s

# run hourly at hh:06:00
[Timer]
OnCalendar=*-*-* *:06:00
Persistent=true
RandomizedDelaySec=30s

# run every 5min
[Timer]
OnBootSec=5min
OnUnitActiveSec=5min
RandomizedDelaySec=30s