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:
@ -6,10 +6,10 @@ Requires=docker.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStartPre=-/usr/bin/docker stop matrix-postgres
|
||||
ExecStartPre=-/usr/bin/docker rm matrix-postgres
|
||||
ExecStartPre=-{{ matrix_host_command_docker }} stop matrix-postgres
|
||||
ExecStartPre=-{{ matrix_host_command_docker }} rm matrix-postgres
|
||||
|
||||
ExecStart=/usr/bin/docker run --rm --name matrix-postgres \
|
||||
ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-postgres \
|
||||
--log-driver=none \
|
||||
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
||||
--cap-drop=ALL \
|
||||
@ -28,8 +28,8 @@ ExecStart=/usr/bin/docker run --rm --name matrix-postgres \
|
||||
{% endfor %}
|
||||
{{ matrix_postgres_docker_image_to_use }}
|
||||
|
||||
ExecStop=-/usr/bin/docker stop matrix-postgres
|
||||
ExecStop=-/usr/bin/docker rm matrix-postgres
|
||||
ExecStop=-{{ matrix_host_command_docker }} stop matrix-postgres
|
||||
ExecStop=-{{ matrix_host_command_docker }} rm matrix-postgres
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
SyslogIdentifier=matrix-postgres
|
||||
|
Reference in New Issue
Block a user