12720: Invoke StartLimitInterval three different ways.
[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 AssertPathExists=/etc/arvados/docker-cleaner/docker-cleaner.json
10
11 # systemd==229 (ubuntu:xenial) obeys StartLimitInterval in the [Unit] section
12 StartLimitInterval=0
13
14 # systemd>=230 (debian:9) obeys StartLimitIntervalSec in the [Unit] section
15 StartLimitIntervalSec=0
16
17 [Service]
18 Type=simple
19 Restart=always
20 RestartSec=10s
21 RestartPreventExitStatus=2
22 #
23 # This unwieldy ExecStart command detects at runtime whether
24 # arvados-docker-cleaner is installed with the Python 3.3 Software
25 # Collection, and if so, invokes it with the "scl" wrapper.
26 ExecStart=/bin/sh -c 'if [ -e /opt/rh/python33/root/bin/arvados-docker-cleaner ]; then exec scl enable python33 arvados-docker-cleaner; else exec arvados-docker-cleaner; fi'
27
28 # systemd<=219 (centos:7, debian:8, ubuntu:trusty) obeys StartLimitInterval in the [Service] section
29 StartLimitInterval=0
30
31 [Install]
32 WantedBy=multi-user.target