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: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit bab403b603)
pull/6464/head
Guillaume Abrioux 2021-04-14 13:41:59 +02:00
parent 4db92dae59
commit ddd7c42c2b
10 changed files with 10 additions and 0 deletions

View File

@ -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 %}

View File

@ -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 %}

View File

@ -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 %}

View File

@ -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 %}

View File

@ -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 %}

View File

@ -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 %}

View File

@ -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

View File

@ -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 %}

View File

@ -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 %}

View File

@ -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 %}