From 914d94cae8ed4817780de7fe412b3cde6797a544 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Tue, 5 Feb 2019 14:19:20 +0100 Subject: [PATCH] set RuntimeDirectory in all systemd unit templates /var/run/ceph resides in a non persistent filesystem (tmpfs) After a reboot, all daemons won't start because this directory will be missing. Signed-off-by: Guillaume Abrioux --- roles/ceph-mds/templates/ceph-mds.service.j2 | 1 + roles/ceph-mgr/templates/ceph-mgr.service.j2 | 1 + roles/ceph-mon/templates/ceph-mon.service.j2 | 1 + roles/ceph-nfs/templates/ceph-nfs.service.j2 | 1 + roles/ceph-osd/templates/ceph-osd.service.j2 | 1 + roles/ceph-rbd-mirror/templates/ceph-rbd-mirror.service.j2 | 1 + roles/ceph-rgw/templates/ceph-radosgw.service.j2 | 1 + 7 files changed, 7 insertions(+) diff --git a/roles/ceph-mds/templates/ceph-mds.service.j2 b/roles/ceph-mds/templates/ceph-mds.service.j2 index 38c4b1691..956917500 100644 --- a/roles/ceph-mds/templates/ceph-mds.service.j2 +++ b/roles/ceph-mds/templates/ceph-mds.service.j2 @@ -4,6 +4,7 @@ After=docker.service [Service] EnvironmentFile=-/etc/environment +RuntimeDirectory=ceph ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-mds-{{ ansible_hostname }} ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-mds-{{ ansible_hostname }} ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \ diff --git a/roles/ceph-mgr/templates/ceph-mgr.service.j2 b/roles/ceph-mgr/templates/ceph-mgr.service.j2 index 889862051..e52a68ac3 100644 --- a/roles/ceph-mgr/templates/ceph-mgr.service.j2 +++ b/roles/ceph-mgr/templates/ceph-mgr.service.j2 @@ -4,6 +4,7 @@ After=docker.service [Service] EnvironmentFile=-/etc/environment +RuntimeDirectory=ceph ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-mgr-{{ ansible_hostname }} ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-mgr-{{ ansible_hostname }} ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \ diff --git a/roles/ceph-mon/templates/ceph-mon.service.j2 b/roles/ceph-mon/templates/ceph-mon.service.j2 index 79718a15f..8485e23b0 100644 --- a/roles/ceph-mon/templates/ceph-mon.service.j2 +++ b/roles/ceph-mon/templates/ceph-mon.service.j2 @@ -4,6 +4,7 @@ After=docker.service [Service] EnvironmentFile=-/etc/environment +RuntimeDirectory=ceph ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-mon-%i ExecStartPre=/bin/sh -c '"$(command -v mkdir)" -p /etc/ceph /var/lib/ceph/mon' ExecStart=/usr/bin/{{ container_binary }} run --rm --name ceph-mon-%i \ diff --git a/roles/ceph-nfs/templates/ceph-nfs.service.j2 b/roles/ceph-nfs/templates/ceph-nfs.service.j2 index 82cc61759..8e57e2dcc 100644 --- a/roles/ceph-nfs/templates/ceph-nfs.service.j2 +++ b/roles/ceph-nfs/templates/ceph-nfs.service.j2 @@ -5,6 +5,7 @@ After=docker.service [Service] EnvironmentFile=-/etc/environment +RuntimeDirectory=ceph ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-nfs-%i ExecStartPre=/usr/bin/mkdir -p /etc/ceph /etc/ganesha /var/lib/nfs/ganesha ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \ diff --git a/roles/ceph-osd/templates/ceph-osd.service.j2 b/roles/ceph-osd/templates/ceph-osd.service.j2 index fc46baf11..8e775661c 100644 --- a/roles/ceph-osd/templates/ceph-osd.service.j2 +++ b/roles/ceph-osd/templates/ceph-osd.service.j2 @@ -5,6 +5,7 @@ After=docker.service [Service] EnvironmentFile=-/etc/environment +RuntimeDirectory=ceph {% if osd_scenario == 'lvm' -%} ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-osd-%i ExecStartPre=-/usr/bin/{{ container_binary }} rm -f ceph-osd-%i diff --git a/roles/ceph-rbd-mirror/templates/ceph-rbd-mirror.service.j2 b/roles/ceph-rbd-mirror/templates/ceph-rbd-mirror.service.j2 index a25633c0a..0073e17b6 100644 --- a/roles/ceph-rbd-mirror/templates/ceph-rbd-mirror.service.j2 +++ b/roles/ceph-rbd-mirror/templates/ceph-rbd-mirror.service.j2 @@ -4,6 +4,7 @@ After=docker.service [Service] EnvironmentFile=-/etc/environment +RuntimeDirectory=ceph ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-rbd-mirror-{{ ansible_hostname }} ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-rbd-mirror-{{ ansible_hostname }} ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \ diff --git a/roles/ceph-rgw/templates/ceph-radosgw.service.j2 b/roles/ceph-rgw/templates/ceph-radosgw.service.j2 index 1e05a8cec..0a69f544a 100644 --- a/roles/ceph-rgw/templates/ceph-radosgw.service.j2 +++ b/roles/ceph-rgw/templates/ceph-radosgw.service.j2 @@ -4,6 +4,7 @@ After=docker.service [Service] EnvironmentFile=/var/lib/ceph/radosgw/ceph-%i/EnvironmentFile +RuntimeDirectory=ceph ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-rgw-{{ ansible_hostname }}-${INST_NAME} ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-rgw-{{ ansible_hostname }}-${INST_NAME} ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \ -- 2.39.5