Commit bab403b6 authored by Guillaume Abrioux's avatar Guillaume Abrioux
Browse files

container/systemd: ensure /var/log/ceph exists

This adds a `ExecStartPre=-/usr/bin/mkdir -p /var/log/ceph` in all
systemd service templates for all ceph daemon.
This is specific to RHCS after a Leapp upgrade is done. Indeed, the
`/var/log/ceph` seems to be removed after the upgrade.
In order to work around this issue let's ensure the directory is present
before trying to start the containers with podman.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1949489

Signed-off-by: default avatarGuillaume Abrioux <gabrioux@redhat.com>
parent 3d426705
......@@ -12,6 +12,7 @@ EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
ExecStartPre=-/usr/bin/{{ container_binary }} rm --storage rbd-target-api
ExecStartPre=-/usr/bin/mkdir -p /var/log/rbd-target-api
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} stop rbd-target-api
{% endif %}
......
......@@ -12,6 +12,7 @@ EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
ExecStartPre=-/usr/bin/{{ container_binary }} rm --storage rbd-target-gw
ExecStartPre=-/usr/bin/mkdir -p /var/log/rbd-target-gw
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} stop rbd-target-gw
{% endif %}
......
......@@ -12,6 +12,7 @@ EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
ExecStartPre=-/usr/bin/{{ container_binary }} rm --storage tcmu-runner
ExecStartPre=-/usr/bin/mkdir -p /var/log/tcmu-runner
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} stop tcmu-runner
{% endif %}
......
......@@ -13,6 +13,7 @@ EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
ExecStartPre=-/usr/bin/{{ container_binary }} rm --storage ceph-mds-{{ ansible_facts['hostname'] }}
ExecStartPre=-/usr/bin/mkdir -p /var/log/ceph
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-mds-{{ ansible_facts['hostname'] }}
{% endif %}
......
......@@ -12,6 +12,7 @@ EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
ExecStartPre=-/usr/bin/{{ container_binary }} rm --storage ceph-mgr-{{ ansible_facts['hostname'] }}
ExecStartPre=-/usr/bin/mkdir -p /var/log/ceph
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-mgr-{{ ansible_facts['hostname'] }}
{% endif %}
......
......@@ -12,6 +12,7 @@ EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
ExecStartPre=-/usr/bin/{{ container_binary }} rm --storage ceph-mon-%i
ExecStartPre=-/usr/bin/mkdir -p /var/log/ceph
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-mon-%i
{% endif %}
......
......@@ -13,6 +13,7 @@ EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
ExecStartPre=-/usr/bin/{{ container_binary }} rm --storage ceph-nfs-%i
ExecStartPre=-/usr/bin/mkdir -p /var/log/ceph /var/log/ganesha
{% endif %}
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-nfs-%i
ExecStartPre={{ '/bin/mkdir' if ansible_facts['os_family'] == 'Debian' else '/usr/bin/mkdir' }} -p /etc/ceph /etc/ganesha /var/lib/nfs/ganesha /var/log/ganesha
......
......@@ -14,6 +14,7 @@ EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
ExecStartPre=-/usr/bin/{{ container_binary }} rm --storage ceph-osd-%i
ExecStartPre=-/usr/bin/mkdir -p /var/log/ceph
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-osd-%i
{% endif %}
......
......@@ -12,6 +12,7 @@ EnvironmentFile=-/etc/environment
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
ExecStartPre=-/usr/bin/{{ container_binary }} rm --storage ceph-rbd-mirror-{{ ansible_facts['hostname'] }}
ExecStartPre=-/usr/bin/mkdir -p /var/log/ceph
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-rbd-mirror-{{ ansible_facts['hostname'] }}
{% endif %}
......
......@@ -13,6 +13,7 @@ EnvironmentFile=/var/lib/ceph/radosgw/{{ cluster }}-%i/EnvironmentFile
{% if container_binary == 'podman' %}
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
ExecStartPre=-/usr/bin/{{ container_binary }} rm --storage ceph-rgw-{{ ansible_facts['hostname'] }}-${INST_NAME}
ExecStartPre=-/usr/bin/mkdir -p /var/log/ceph
{% else %}
ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-rgw-{{ ansible_facts['hostname'] }}-${INST_NAME}
{% endif %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment