16106: Merge branch 'master' into 16106-azure-spot-instance-support
[arvados.git] / services / dockercleaner / arvados-docker-cleaner.service
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 [Unit]
6 Description=Arvados Docker Image Cleaner
7 Documentation=https://doc.arvados.org/
8 After=network.target
9
10 # systemd==229 (ubuntu:xenial) obeys StartLimitInterval in the [Unit] section
11 StartLimitInterval=0
12
13 # systemd>=230 (debian:9) obeys StartLimitIntervalSec in the [Unit] section
14 StartLimitIntervalSec=0
15
16 [Service]
17 Type=simple
18 Restart=always
19 RestartSec=10s
20 RestartPreventExitStatus=2
21 #
22 # This unwieldy ExecStart command detects at runtime whether
23 # arvados-docker-cleaner is installed with the Python 3.3 Software
24 # Collection, and if so, invokes it with the "scl" wrapper.
25 ExecStart=/bin/sh -c 'if [ -e /opt/rh/rh-python36/root/bin/arvados-docker-cleaner ]; then exec scl enable rh-python36 arvados-docker-cleaner; else exec arvados-docker-cleaner; fi'
26
27 # systemd<=219 (centos:7, debian:8, ubuntu:trusty) obeys StartLimitInterval in the [Service] section
28 StartLimitInterval=0
29
30 [Install]
31 WantedBy=multi-user.target