]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
fine-grained control systemd to start/stop/restart ceph services at once 6276/head
authorZhi Zhang <zhangz.david@outlook.com>
Mon, 26 Oct 2015 07:13:19 +0000 (15:13 +0800)
committerZhi Zhang <zhangz.david@outlook.com>
Mon, 26 Oct 2015 07:13:19 +0000 (15:13 +0800)
Signed-off-by: Zhi Zhang <zhangz.david@outlook.com>
ceph.spec.in
systemd/Makefile.am
systemd/ceph-mds.target [new file with mode: 0644]
systemd/ceph-mds@.service
systemd/ceph-mon.target [new file with mode: 0644]
systemd/ceph-mon@.service
systemd/ceph-osd.target [new file with mode: 0644]
systemd/ceph-osd@.service
systemd/ceph-radosgw.target [new file with mode: 0644]
systemd/ceph-radosgw@.service

index 173c8f20d6c0485ef249840022234eb552ae88b8..a74a7cfab81f7bd8205cfdfb9d5890f96b4a1aee 100644 (file)
@@ -621,6 +621,10 @@ install -m 0644 -D etc/sysconfig/ceph $RPM_BUILD_ROOT%{_localstatedir}/adm/fillu
   install -m 0644 -D systemd/ceph-mds@.service $RPM_BUILD_ROOT%{_unitdir}/ceph-mds@.service
   install -m 0644 -D systemd/ceph-radosgw@.service $RPM_BUILD_ROOT%{_unitdir}/ceph-radosgw@.service
   install -m 0644 -D systemd/ceph.target $RPM_BUILD_ROOT%{_unitdir}/ceph.target
+  install -m 0644 -D systemd/ceph-osd.target $RPM_BUILD_ROOT%{_unitdir}/ceph-osd.target
+  install -m 0644 -D systemd/ceph-mon.target $RPM_BUILD_ROOT%{_unitdir}/ceph-mon.target
+  install -m 0644 -D systemd/ceph-mds.target $RPM_BUILD_ROOT%{_unitdir}/ceph-mds.target
+  install -m 0644 -D systemd/ceph-radosgw.target $RPM_BUILD_ROOT%{_unitdir}/ceph-radosgw.target
   install -m 0644 -D systemd/ceph-disk@.service $RPM_BUILD_ROOT%{_unitdir}/ceph-disk@.service
   install -m 0755 -D systemd/ceph $RPM_BUILD_ROOT%{_sbindir}/rcceph
 %else
@@ -778,6 +782,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_unitdir}/ceph-radosgw@.service
 %{_unitdir}/ceph-disk@.service
 %{_unitdir}/ceph.target
+%{_unitdir}/ceph-osd.target
+%{_unitdir}/ceph-mon.target
+%{_unitdir}/ceph-mds.target
+%{_unitdir}/ceph-radosgw.target
 %else
 %{_initrddir}/ceph
 %endif
index b7fde384c83d1370acd7cb4b6a5d633d0674aead..19f87fb3b163c8050acef80c043406accc590bf6 100644 (file)
@@ -1,5 +1,9 @@
 unitfiles = \
        ceph.target \
+        ceph-osd.target \
+        ceph-mon.target \
+        ceph-mds.target \
+        ceph-radosgw.target \
        ceph-mds@.service \
        ceph-mon@.service \
        ceph-create-keys@.service \
diff --git a/systemd/ceph-mds.target b/systemd/ceph-mds.target
new file mode 100644 (file)
index 0000000..fbf1ba1
--- /dev/null
@@ -0,0 +1,5 @@
+[Unit]
+Description=ceph target allowing to start/stop all ceph-mds@.service instances at once
+PartOf=ceph.target
+[Install]
+WantedBy=multi-user.target ceph.target
index f86f4ee4d97bc9407d64a955b070e925218ffcde..708f42c815420eac87721a4036460826d84ea7ce 100644 (file)
@@ -2,7 +2,7 @@
 Description=Ceph metadata server daemon
 After=network-online.target local-fs.target
 Wants=network-online.target local-fs.target
-PartOf=ceph.target
+PartOf=ceph-mds.target
 
 [Service]
 LimitNOFILE=1048576
@@ -13,4 +13,4 @@ ExecStart=/usr/bin/ceph-mds -f --cluster ${CLUSTER} --id %i --setuser ceph --set
 ExecReload=/bin/kill -HUP $MAINPID
 
 [Install]
-WantedBy=ceph.target
+WantedBy=ceph-mds.target
diff --git a/systemd/ceph-mon.target b/systemd/ceph-mon.target
new file mode 100644 (file)
index 0000000..87b585f
--- /dev/null
@@ -0,0 +1,5 @@
+[Unit]
+Description=ceph target allowing to start/stop all ceph-mon@.service instances at once
+PartOf=ceph.target
+[Install]
+WantedBy=multi-user.target ceph.target
index a0eeff8300add339a8627d6c874246cc0d2667ec..03a9b6c19e33999bbb81c6c865422bdfb0b80925 100644 (file)
@@ -8,7 +8,7 @@ Description=Ceph cluster monitor daemon
 After=network-online.target local-fs.target ceph-create-keys@%i.service
 Wants=network-online.target local-fs.target ceph-create-keys@%i.service
 
-PartOf=ceph.target
+PartOf=ceph-mon.target
 
 [Service]
 LimitNOFILE=1048576
@@ -19,4 +19,4 @@ ExecStart=/usr/bin/ceph-mon -f --cluster ${CLUSTER} --id %i --setuser ceph --set
 ExecReload=/bin/kill -HUP $MAINPID
 
 [Install]
-WantedBy=ceph.target
+WantedBy=ceph-mon.target
diff --git a/systemd/ceph-osd.target b/systemd/ceph-osd.target
new file mode 100644 (file)
index 0000000..ed55fc2
--- /dev/null
@@ -0,0 +1,5 @@
+[Unit]
+Description=ceph target allowing to start/stop all ceph-osd@.service instances at once
+PartOf=ceph.target
+[Install]
+WantedBy=multi-user.target ceph.target
index 5a9314ec0a51e487a56d8ad121745a12587407c8..82dabdfe38df130450e9ad45ecb90d65e07a802a 100644 (file)
@@ -2,7 +2,7 @@
 Description=Ceph object storage daemon
 After=network-online.target local-fs.target
 Wants=network-online.target local-fs.target
-PartOf=ceph.target
+PartOf=ceph-osd.target
 
 [Service]
 LimitNOFILE=1048576
@@ -14,4 +14,4 @@ ExecStartPre=/usr/libexec/ceph/ceph-osd-prestart.sh --cluster ${CLUSTER} --id %i
 ExecReload=/bin/kill -HUP $MAINPID
 
 [Install]
-WantedBy=ceph.target
+WantedBy=ceph-osd.target
diff --git a/systemd/ceph-radosgw.target b/systemd/ceph-radosgw.target
new file mode 100644 (file)
index 0000000..959eb51
--- /dev/null
@@ -0,0 +1,5 @@
+[Unit]
+Description=ceph target allowing to start/stop all ceph-radosgw@.service instances at once
+PartOf=ceph.target
+[Install]
+WantedBy=multi-user.target ceph.target
index fccd0116770dac7c0f5230f5af956ce09c0892df..fb09e190d61f42b1a0b57ee3a58d230579b560e2 100644 (file)
@@ -2,7 +2,7 @@
 Description=Ceph rados gateway
 After=network-online.target local-fs.target
 Wants=network-online.target local-fs.target
-PartOf=ceph.target
+PartOf=ceph-radosgw.target
 
 [Service]
 LimitNOFILE=1048576
@@ -12,4 +12,4 @@ Environment=CLUSTER=ceph
 ExecStart=/usr/bin/radosgw -f --cluster ${CLUSTER} --name client.%i --setuser ceph --setgroup ceph
 
 [Install]
-WantedBy=ceph.target
+WantedBy=ceph-radosgw.target