Remove hardcoded command paths in systemd unit files

Depending on the distro, common commands like sleep and chown may either
be located in /bin or /usr/bin.

Systemd added path lookup to ExecStart in v239, allowing only the
command name to be put in unit files and not the full path as
historically required. At least Ubuntu 18.04 LTS is however still on
v237 so we should maintain portability for a while longer.
This commit is contained in:
Chris van Dijk
2020-05-27 18:53:52 +02:00
parent f8157a94ef
commit 6334f6c1ea
26 changed files with 150 additions and 145 deletions

View File

@ -11,13 +11,13 @@ Wants={{ service }}
[Service]
Type=simple
ExecStartPre=-/usr/bin/docker kill matrix-mx-puppet-skype
ExecStartPre=-/usr/bin/docker rm matrix-mx-puppet-skype
ExecStartPre=-{{ matrix_host_command_docker }} kill matrix-mx-puppet-skype
ExecStartPre=-{{ matrix_host_command_docker }} rm matrix-mx-puppet-skype
# Intentional delay, so that the homeserver (we likely depend on) can manage to start.
ExecStartPre=/bin/sleep 5
ExecStartPre={{ matrix_host_command_sleep }} 5
ExecStart=/usr/bin/docker run --rm --name matrix-mx-puppet-skype \
ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-mx-puppet-skype \
--log-driver=none \
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
--cap-drop=ALL \
@ -31,8 +31,8 @@ ExecStart=/usr/bin/docker run --rm --name matrix-mx-puppet-skype \
{% endfor %}
{{ matrix_mx_puppet_skype_docker_image }}
ExecStop=-/usr/bin/docker kill matrix-mx-puppet-skype
ExecStop=-/usr/bin/docker rm matrix-mx-puppet-skype
ExecStop=-{{ matrix_host_command_docker }} kill matrix-mx-puppet-skype
ExecStop=-{{ matrix_host_command_docker }} rm matrix-mx-puppet-skype
Restart=always
RestartSec=30
SyslogIdentifier=matrix-mx-puppet-skype