container: align systemd units with rpm

Update `After=` and `Wants=` parameters in container systemd units
and make them be aligned with the systemd units that come
from the packaging.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
pull/7032/head
Guillaume Abrioux 2021-12-08 17:37:14 +01:00
parent 7ece59b41d
commit f01536ea19
15 changed files with 45 additions and 30 deletions

View File

@ -1,11 +1,12 @@
[Unit]
Description=Ceph crash dump collector
{% if container_binary == 'docker' %}
After=docker.service
After=docker.service network-online.target local-fs.target time-sync.target
Requires=docker.service
{% else %}
After=network.target
After=network-online.target local-fs.target time-sync.target
{% endif %}
Wants=network-online.target local-fs.target time-sync.target
[Service]
{% if container_binary == 'podman' %}

View File

@ -3,11 +3,12 @@
[Unit]
Description=grafana-server
{% if container_binary == 'docker' %}
After=docker.service
After=docker.service network-online.target local-fs.target time-sync.target
Requires=docker.service
{% else %}
After=network.target
After=network-online.target local-fs.target time-sync.target
{% endif %}
Wants=network-online.target local-fs.target time-sync.target
[Service]
EnvironmentFile=-/etc/environment

View File

@ -1,11 +1,12 @@
[Unit]
Description=RBD Target API Service
{% if container_binary == 'docker' %}
After=docker.service
After=docker.service network-online.target local-fs.target time-sync.target
Requires=docker.service
{% else %}
After=network.target
After=network-online.target local-fs.target time-sync.target
{% endif %}
Wants=network-online.target local-fs.target time-sync.target
[Service]
EnvironmentFile=-/etc/environment

View File

@ -1,11 +1,12 @@
[Unit]
Description=RBD Target Gateway Service
{% if container_binary == 'docker' %}
After=docker.service
After=docker.service network-online.target local-fs.target time-sync.target
Requires=docker.service
{% else %}
After=network.target
After=network-online.target local-fs.target time-sync.target
{% endif %}
Wants=network-online.target local-fs.target time-sync.target
[Service]
EnvironmentFile=-/etc/environment

View File

@ -1,11 +1,12 @@
[Unit]
Description=TCMU Runner
{% if container_binary == 'docker' %}
After=docker.service
After=docker.service network-online.target local-fs.target time-sync.target
Requires=docker.service
{% else %}
After=network.target
After=network-online.target local-fs.target time-sync.target
{% endif %}
Wants=network-online.target local-fs.target time-sync.target
[Service]
EnvironmentFile=-/etc/environment

View File

@ -2,11 +2,12 @@
Description=Ceph MDS
PartOf=ceph-mds.target
{% if container_binary == 'docker' %}
After=docker.service
After=docker.service network-online.target local-fs.target time-sync.target
Requires=docker.service
{% else %}
After=network.target
After=network-online.target local-fs.target time-sync.target
{% endif %}
Wants=network-online.target local-fs.target time-sync.target
{% set cpu_limit = ansible_facts['processor_vcpus']|int if ceph_mds_docker_cpu_limit|int > ansible_facts['processor_vcpus']|int else ceph_mds_docker_cpu_limit|int %}
[Service]

View File

@ -2,11 +2,12 @@
Description=Ceph Manager
PartOf=ceph-mgr.target
{% if container_binary == 'docker' %}
After=docker.service
After=docker.service network-online.target local-fs.target time-sync.target
Requires=docker.service
{% else %}
After=network.target
After=network-online.target local-fs.target time-sync.target
{% endif %}
Wants=network-online.target local-fs.target time-sync.target
[Service]
EnvironmentFile=-/etc/environment

View File

@ -2,11 +2,12 @@
Description=Ceph Monitor
PartOf=ceph-mon.target
{% if container_binary == 'docker' %}
After=docker.service
After=docker.service network-online.target local-fs.target time-sync.target
Requires=docker.service
{% else %}
After=network.target
After=network-online.target local-fs.target time-sync.target
{% endif %}
Wants=network-online.target local-fs.target time-sync.target
[Service]
EnvironmentFile=-/etc/environment

View File

@ -2,11 +2,12 @@
Description=NFS-Ganesha file server
Documentation=http://github.com/nfs-ganesha/nfs-ganesha/wiki
{% if container_binary == 'docker' %}
After=docker.service
After=docker.service network-online.target local-fs.target time-sync.target
Requires=docker.service
{% else %}
After=network.target
After=network-online.target local-fs.target time-sync.target
{% endif %}
Wants=network-online.target local-fs.target time-sync.target
[Service]
EnvironmentFile=-/etc/environment

View File

@ -3,11 +3,12 @@
[Unit]
Description=Node Exporter
{% if container_binary == 'docker' %}
After=docker.service
After=docker.service network-online.target local-fs.target time-sync.target
Requires=docker.service
{% else %}
After=network.target
After=network-online.target local-fs.target time-sync.target
{% endif %}
Wants=network-online.target local-fs.target time-sync.target
[Service]
EnvironmentFile=-/etc/environment

View File

@ -3,11 +3,12 @@
Description=Ceph OSD
PartOf=ceph-osd.target
{% if container_binary == 'docker' %}
After=docker.service
After=docker.service network-online.target local-fs.target time-sync.target
Requires=docker.service
{% else %}
After=network.target
After=network-online.target local-fs.target time-sync.target
{% endif %}
Wants=network-online.target local-fs.target time-sync.target
{% set cpu_limit = ansible_facts['processor_vcpus']|int if ceph_osd_docker_cpu_limit|int > ansible_facts['processor_vcpus']|int else ceph_osd_docker_cpu_limit|int %}
[Service]

View File

@ -3,11 +3,12 @@
[Unit]
Description=alertmanager
{% if container_binary == 'docker' %}
After=docker.service
After=docker.service network-online.target local-fs.target time-sync.target
Requires=docker.service
{% else %}
After=network.target
After=network-online.target local-fs.target time-sync.target
{% endif %}
Wants=network-online.target local-fs.target time-sync.target
[Service]
WorkingDirectory={{ alertmanager_data_dir }}

View File

@ -3,11 +3,12 @@
[Unit]
Description=prometheus
{% if container_binary == 'docker' %}
After=docker.service
After=docker.service network-online.target local-fs.target time-sync.target
Requires=docker.service
{% else %}
After=network.target
After=network-online.target local-fs.target time-sync.target
{% endif %}
Wants=network-online.target local-fs.target time-sync.target
[Service]
EnvironmentFile=-/etc/environment

View File

@ -2,11 +2,12 @@
Description=Ceph RBD mirror
PartOf=ceph-rbd-mirror.target
{% if container_binary == 'docker' %}
After=docker.service
After=docker.service network-online.target local-fs.target time-sync.target
Requires=docker.service
{% else %}
After=network.target
After=network-online.target local-fs.target time-sync.target
{% endif %}
Wants=network-online.target local-fs.target time-sync.target
[Service]
EnvironmentFile=-/etc/environment

View File

@ -2,11 +2,12 @@
Description=Ceph RGW
PartOf=ceph-radosgw.target
{% if container_binary == 'docker' %}
After=docker.service
After=docker.service network-online.target local-fs.target time-sync.target
Requires=docker.service
{% else %}
After=network.target
After=network-online.target local-fs.target time-sync.target
{% endif %}
Wants=network-online.target local-fs.target time-sync.target
{% set cpu_limit = ansible_facts['processor_vcpus']|int if ceph_rgw_docker_cpu_limit|int > ansible_facts['processor_vcpus']|int else ceph_rgw_docker_cpu_limit|int %}
[Service]