From: Milan Broz Date: Mon, 17 Aug 2015 10:48:17 +0000 (+0200) Subject: Update rpm spec to properly restart systemd ceph.target. X-Git-Tag: v9.1.0~354^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=14da7e20d9625dff3f0941ebe24b23d8399693cf;p=ceph.git Update rpm spec to properly restart systemd ceph.target. If we are using systemd, ceph target should be used. Also fail to restart service should not stop policy to load. Signed-off-by: Milan Broz --- diff --git a/ceph.spec.in b/ceph.spec.in index e33b3f767d37..e207b3fe0563 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -1137,24 +1137,42 @@ ln -sf %{_libdir}/librbd.so.1 /usr/lib64/qemu/librbd.so.1 %{_mandir}/man8/ceph_selinux.8.* %post selinux -/sbin/service ceph stop >/dev/null 2>&1 +%if 0%{?_with_systemd} + /usr/bin/systemctl stop ceph.target > /dev/null 2>&1 || : +%else + /sbin/service ceph stop >/dev/null 2>&1 || : +%endif + semodule -n -i %{_datadir}/selinux/packages/ceph.pp if /usr/sbin/selinuxenabled ; then /usr/sbin/load_policy %relabel_files fi -/sbin/service ceph start >/dev/null 2>&1 + +%if 0%{?_with_systemd} + /usr/bin/systemctl start ceph.target > /dev/null 2>&1 || : +%else + /sbin/service ceph start >/dev/null 2>&1 || : +%endif exit 0 %postun selinux if [ $1 -eq 0 ]; then - /sbin/service ceph stop >/dev/null 2>&1 + %if 0%{?_with_systemd} + /usr/bin/systemctl stop ceph.target > /dev/null 2>&1 || : + %else + /sbin/service ceph stop >/dev/null 2>&1 || : + %endif semodule -n -r ceph if /usr/sbin/selinuxenabled ; then /usr/sbin/load_policy %relabel_files fi; - /sbin/service ceph start >/dev/null 2>&1 + %if 0%{?_with_systemd} + /usr/bin/systemctl start ceph.target > /dev/null 2>&1 || : + %else + /sbin/service ceph start >/dev/null 2>&1 || : + %endif fi; exit 0