From 30e3ae27e0b99ae9b7f3234dbb93260ebda91466 Mon Sep 17 00:00:00 2001 From: Boris Ranto Date: Fri, 26 May 2017 09:52:25 +0200 Subject: [PATCH] rpm: Move ceph-disk to ceph-base The SELinux package now requires the ceph-disk binary but that one was part of the ceph-osd package. The ceph-disk python library is already packaged in ceph-base so moving ceph-disk to ceph-base seems like a reasonable next step. Signed-off-by: Boris Ranto (cherry picked from commit 6991764f3bff7b8f6be699603927aff882377878) Conflicts: ceph.spec.in: ceph-disk-udev is present in kraken --- ceph.spec.in | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/ceph.spec.in b/ceph.spec.in index 5cb781227ed07..fa719e4fba0cd 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -838,6 +838,8 @@ rm -rf %{buildroot} %{_bindir}/ceph-detect-init %{_libexecdir}/systemd/system-preset/50-ceph.preset %{_sbindir}/ceph-create-keys +%{_sbindir}/ceph-disk +%{_sbindir}/ceph-disk-udev %{_sbindir}/rcceph %dir %{_libexecdir}/ceph %{_libexecdir}/ceph/ceph_common.sh @@ -862,12 +864,14 @@ rm -rf %{buildroot} %config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/ceph-mon %config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/ceph-osd-mds %endif +%{_unitdir}/ceph-disk@.service %{_unitdir}/ceph.target %{python_sitelib}/ceph_detect_init* %{python_sitelib}/ceph_disk* %{_mandir}/man8/ceph-deploy.8* %{_mandir}/man8/ceph-detect-init.8* %{_mandir}/man8/ceph-create-keys.8* +%{_mandir}/man8/ceph-disk.8* %{_mandir}/man8/ceph-run.8* %{_mandir}/man8/crushtool.8* %{_mandir}/man8/osdmaptool.8* @@ -883,11 +887,11 @@ rm -rf %{buildroot} %if 0%{?suse_version} %fillup_only if [ $1 -eq 1 ] ; then - /usr/bin/systemctl preset ceph.target >/dev/null 2>&1 || : + /usr/bin/systemctl preset ceph-disk@\*.service ceph.target >/dev/null 2>&1 || : fi %endif %if 0%{?fedora} || 0%{?rhel} -%systemd_post ceph.target +%systemd_post ceph-disk@\*.service ceph.target %endif if [ $1 -eq 1 ] ; then /usr/bin/systemctl start ceph.target >/dev/null 2>&1 || : @@ -895,21 +899,32 @@ fi %preun base %if 0%{?suse_version} -%service_del_preun ceph.target +%service_del_preun ceph-disk@\*.service ceph.target %endif %if 0%{?fedora} || 0%{?rhel} -%systemd_preun ceph.target +%systemd_preun ceph-disk@\*.service ceph.target %endif %postun base /sbin/ldconfig %if 0%{?suse_version} DISABLE_RESTART_ON_UPDATE="yes" -%service_del_postun ceph.target +%service_del_postun ceph-disk@\*.service ceph.target %endif %if 0%{?fedora} || 0%{?rhel} -%systemd_postun ceph.target +%systemd_postun ceph-disk@\*.service ceph.target %endif +if [ $FIRST_ARG -ge 1 ] ; then + # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to + # "yes". In any case: if units are not running, do not touch them. + SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph + if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then + source $SYSCONF_CEPH + fi + if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then + /usr/bin/systemctl try-restart ceph-disk@\*.service > /dev/null 2>&1 || : + fi +fi %files common %defattr(-,root,root,-) @@ -1281,31 +1296,27 @@ fi %{_bindir}/ceph-bluefs-tool %{_bindir}/ceph-objectstore-tool %{_bindir}/ceph-osd -%{_sbindir}/ceph-disk -%{_sbindir}/ceph-disk-udev %{_libexecdir}/ceph/ceph-osd-prestart.sh %dir %{_udevrulesdir} %{_udevrulesdir}/60-ceph-by-parttypeuuid.rules %{_udevrulesdir}/95-ceph-osd.rules %{_mandir}/man8/ceph-clsinfo.8* -%{_mandir}/man8/ceph-disk.8* %{_mandir}/man8/ceph-osd.8* %if 0%{?rhel} && ! 0%{?centos} %{_sysconfdir}/cron.hourly/subman %endif %{_unitdir}/ceph-osd@.service %{_unitdir}/ceph-osd.target -%{_unitdir}/ceph-disk@.service %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd %post osd %if 0%{?suse_version} if [ $1 -eq 1 ] ; then - /usr/bin/systemctl preset ceph-disk@\*.service ceph-osd@\*.service ceph-osd.target >/dev/null 2>&1 || : + /usr/bin/systemctl preset ceph-osd@\*.service ceph-osd.target >/dev/null 2>&1 || : fi %endif %if 0%{?fedora} || 0%{?rhel} -%systemd_post ceph-disk@\*.service ceph-osd@\*.service ceph-osd.target +%systemd_post ceph-osd@\*.service ceph-osd.target %endif if [ $1 -eq 1 ] ; then /usr/bin/systemctl start ceph-osd.target >/dev/null 2>&1 || : @@ -1313,20 +1324,20 @@ fi %preun osd %if 0%{?suse_version} -%service_del_preun ceph-disk@\*.service ceph-osd@\*.service ceph-osd.target +%service_del_preun ceph-osd@\*.service ceph-osd.target %endif %if 0%{?fedora} || 0%{?rhel} -%systemd_preun ceph-disk@\*.service ceph-osd@\*.service ceph-osd.target +%systemd_preun ceph-osd@\*.service ceph-osd.target %endif %postun osd test -n "$FIRST_ARG" || FIRST_ARG=$1 %if 0%{?suse_version} DISABLE_RESTART_ON_UPDATE="yes" -%service_del_postun ceph-disk@\*.service ceph-osd@\*.service ceph-osd.target +%service_del_postun ceph-osd@\*.service ceph-osd.target %endif %if 0%{?fedora} || 0%{?rhel} -%systemd_postun ceph-disk@\*.service ceph-osd@\*.service ceph-osd.target +%systemd_postun ceph-osd@\*.service ceph-osd.target %endif if [ $FIRST_ARG -ge 1 ] ; then # Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to @@ -1336,7 +1347,7 @@ if [ $FIRST_ARG -ge 1 ] ; then source $SYSCONF_CEPH fi if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then - /usr/bin/systemctl try-restart ceph-disk@\*.service ceph-osd@\*.service > /dev/null 2>&1 || : + /usr/bin/systemctl try-restart ceph-osd@\*.service > /dev/null 2>&1 || : fi fi -- 2.39.5