Skip to content

Commit

Permalink
container: align systemd units with rpm
Browse files Browse the repository at this point in the history
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>
(cherry picked from commit f01536e)
  • Loading branch information
guits committed Dec 15, 2021
1 parent 87b24a7 commit e083d9f
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 30 deletions.
5 changes: 3 additions & 2 deletions roles/ceph-crash/templates/ceph-crash.service.j2
Original file line number Diff line number Diff line change
@@ -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' %}
Expand Down
5 changes: 3 additions & 2 deletions roles/ceph-grafana/templates/grafana-server.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions roles/ceph-iscsi-gw/templates/rbd-target-api.service.j2
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions roles/ceph-iscsi-gw/templates/rbd-target-gw.service.j2
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions roles/ceph-iscsi-gw/templates/tcmu-runner.service.j2
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions roles/ceph-mds/templates/ceph-mds.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 3 additions & 2 deletions roles/ceph-mgr/templates/ceph-mgr.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions roles/ceph-mon/templates/ceph-mon.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions roles/ceph-nfs/templates/ceph-nfs.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions roles/ceph-node-exporter/templates/node_exporter.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions roles/ceph-osd/templates/ceph-osd.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 3 additions & 2 deletions roles/ceph-prometheus/templates/alertmanager.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
5 changes: 3 additions & 2 deletions roles/ceph-prometheus/templates/prometheus.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions roles/ceph-rbd-mirror/templates/ceph-rbd-mirror.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions roles/ceph-rgw/templates/ceph-radosgw.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit e083d9f

Please sign in to comment.