File 0014-Added-a-systemd-target-for-ceph.patch of Package ceph.627
From: Owen Synge <osynge@suse.com>
Date: Wed, 10 Sep 2014 10:12:13 +0200
Subject: [PATCH] Added a systemd target for ceph
ceph now has a target structure for systemd
set boot up sequence after network-online.target local-fs.target for mon osd and mds
Thanks to tserong@suse.com for correcting the target behaviour.
Signed of by Owen Synge - osynge@suse.com
(cherry picked from commit 7479f030dd97c94b3db6fb74f3c3f0344dc9e615)
---
systemd/ceph-mds@.service | 5 ++++-
systemd/ceph-mon@.service | 7 ++++---
systemd/ceph-osd@.service | 5 ++++-
systemd/ceph.target | 4 ++++
4 files changed, 16 insertions(+), 5 deletions(-)
create mode 100644 systemd/ceph.target
diff --git a/systemd/ceph-mds@.service b/systemd/ceph-mds@.service
index 08bab79..22a787d 100644
--- a/systemd/ceph-mds@.service
+++ b/systemd/ceph-mds@.service
@@ -1,5 +1,8 @@
[Unit]
Description=Ceph metadata server daemon
+After=network-online.target local-fs.target
+Wants=network-online.target local-fs.target
+PartOf=ceph.target
[Service]
EnvironmentFile=-/etc/sysconfig/ceph
@@ -7,4 +10,4 @@ Environment=CLUSTER=ceph
ExecStart=/usr/bin/ceph-mds -f --cluster ${CLUSTER} --id %i
[Install]
-WantedBy=multi-user.target
+WantedBy=ceph.target
diff --git a/systemd/ceph-mon@.service b/systemd/ceph-mon@.service
index 8ba0843..437ef4d 100644
--- a/systemd/ceph-mon@.service
+++ b/systemd/ceph-mon@.service
@@ -5,8 +5,9 @@ Description=Ceph cluster monitor daemon
# http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget
# these can be removed once ceph-mon will dynamically change network
# configuration.
-After=network-online.target
-Wants=network-online.target
+After=network-online.target local-fs.target
+Wants=network-online.target local-fs.target
+PartOf=ceph.target
[Service]
EnvironmentFile=-/etc/sysconfig/ceph
@@ -14,4 +15,4 @@ Environment=CLUSTER=ceph
ExecStart=/usr/bin/ceph-mon -f --cluster ${CLUSTER} --id %i
[Install]
-WantedBy=multi-user.target
+WantedBy=ceph.target
diff --git a/systemd/ceph-osd@.service b/systemd/ceph-osd@.service
index 1811d7e..edb24ad 100644
--- a/systemd/ceph-osd@.service
+++ b/systemd/ceph-osd@.service
@@ -1,5 +1,8 @@
[Unit]
Description=Ceph object storage daemon
+After=network-online.target local-fs.target
+Wants=network-online.target local-fs.target
+PartOf=ceph.target
[Service]
EnvironmentFile=-/etc/sysconfig/ceph
@@ -8,4 +11,4 @@ ExecStart=/usr/bin/ceph-osd -f --cluster ${CLUSTER} --id %i
ExecStartPre=/usr/libexec/ceph/ceph-osd-prestart.sh --cluster ${CLUSTER} --id %i
[Install]
-WantedBy=multi-user.target
+WantedBy=ceph.target
diff --git a/systemd/ceph.target b/systemd/ceph.target
new file mode 100644
index 0000000..60734ba
--- /dev/null
+++ b/systemd/ceph.target
@@ -0,0 +1,4 @@
+[Unit]
+Description=ceph target allowing to start/stop all ceph*@.service instances at once
+[Install]
+WantedBy=multi-user.target