[Unit]
Description=Start the dask %i service.
After=network.target

[Service]
Type=simple
PermissionsStartOnly=true
NoNewPrivileges=true
KillSignal=SIGTERM
ExecStartPre={{ python_bin }} -c "import getpass,urllib.request; urllib.request.urlretrieve('https://raw.githubusercontent.com/freva-org/freva-nextgen/main/freva-data-portal-worker/data-loader', f'/tmp/data-loader-{getpass.getuser()}')"
ExecStart=/bin/sh -c "/bin/sh /tmp/data-loader-$(whoami) %i"
Restart=on-failure
RestartSec=5
StartLimitBurst=5
UMask=007

[Install]
WantedBy=default.target
