From 1cc76053a87910adc18e8cdc22f014a3c11ab647 Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Sun, 11 Oct 2015 10:02:40 +0200 Subject: [PATCH] rpm: drop _with_systemd Ceph versions jewel and above only support systemd. Signed-off-by: Nathan Cutler (cherry picked from commit 2ca6dd250b6a049f27fa17c5e8ca11674acb63f6) --- ceph.spec.in | 103 +++------------------------------------------------ 1 file changed, 5 insertions(+), 98 deletions(-) diff --git a/ceph.spec.in b/ceph.spec.in index 2e66e9999a265..e9712931fa69c 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -50,16 +50,7 @@ restorecon -R /var/log/radosgw > /dev/null 2>&1; %endif %{!?_udevrulesdir: %global _udevrulesdir /lib/udev/rules.d} - -# Use systemd files on RHEL 7 and above and in SUSE/openSUSE. -# Note: We don't install unit files for the services yet. For now, -# the _with_systemd variable only implies that we'll install -# /etc/tmpfiles.d/ceph.conf in order to set up the socket directory in -# /var/run/ceph. -%if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?suse_version} -%global _with_systemd 1 %{!?tmpfiles_create: %global tmpfiles_create systemd-tmpfiles --create} -%endif # unify libexec for all targets %global _libexecdir %{_exec_prefix}/lib @@ -133,12 +124,10 @@ BuildRequires: yasm # distro-conditional dependencies ################################################################################# %if 0%{?suse_version} -%if 0%{?_with_systemd} BuildRequires: pkgconfig(systemd) BuildRequires: systemd-rpm-macros BuildRequires: systemd %{?systemd_requires} -%endif PreReq: %fillup_prereq BuildRequires: net-tools BuildRequires: libbz2-devel @@ -155,9 +144,7 @@ BuildRequires: openldap2-devel BuildRequires: python-Cython %endif %if 0%{?fedora} || 0%{?rhel} -%if 0%{?_with_systemd} Requires: systemd -%endif BuildRequires: btrfs-progs BuildRequires: nss-devel BuildRequires: keyutils-libs-devel @@ -261,9 +248,7 @@ Requires: python-rados = %{epoch}:%{version}-%{release} Requires: python-rbd = %{epoch}:%{version}-%{release} Requires: python-cephfs = %{epoch}:%{version}-%{release} Requires: python-requests -%if 0%{?_with_systemd} %{?systemd_requires} -%endif %if 0%{?suse_version} Requires(pre): pwdutils %endif @@ -682,9 +667,7 @@ export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed -e 's/i386/i486/'` %if 0%{?rhel} && ! 0%{?centos} --enable-subman \ %endif -%if 0%{?_with_systemd} --with-systemdsystemunitdir=%_unitdir \ -%endif --docdir=%{_docdir}/ceph \ --with-man-pages \ --mandir="%_mandir" \ @@ -737,17 +720,9 @@ install -m 0644 -D etc/sysconfig/ceph $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ce %if 0%{?suse_version} install -m 0644 -D etc/sysconfig/ceph $RPM_BUILD_ROOT%{_localstatedir}/adm/fillup-templates/sysconfig.%{name} %endif -%if 0%{?_with_systemd} - install -m 0644 -D systemd/ceph.tmpfiles.d $RPM_BUILD_ROOT%{_tmpfilesdir}/ceph-common.conf - install -m 0755 -D systemd/ceph $RPM_BUILD_ROOT%{_sbindir}/rcceph - install -m 0644 -D systemd/50-ceph.preset $RPM_BUILD_ROOT%{_libexecdir}/systemd/system-preset/50-ceph.preset -%else - install -D src/init-rbdmap $RPM_BUILD_ROOT%{_initrddir}/rbdmap - install -D src/init-ceph $RPM_BUILD_ROOT%{_initrddir}/ceph - install -D src/init-radosgw $RPM_BUILD_ROOT%{_initrddir}/ceph-radosgw - ln -sf ../../etc/init.d/ceph %{buildroot}/%{_sbindir}/rcceph - ln -sf ../../etc/init.d/ceph-radosgw %{buildroot}/%{_sbindir}/rcceph-radosgw -%endif +install -m 0644 -D systemd/ceph.tmpfiles.d $RPM_BUILD_ROOT%{_tmpfilesdir}/ceph-common.conf +install -m 0755 -D systemd/ceph $RPM_BUILD_ROOT%{_sbindir}/rcceph +install -m 0644 -D systemd/50-ceph.preset $RPM_BUILD_ROOT%{_libexecdir}/systemd/system-preset/50-ceph.preset mkdir -p $RPM_BUILD_ROOT%{_sbindir} install -m 0644 -D src/logrotate.conf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/ceph chmod 0644 $RPM_BUILD_ROOT%{_docdir}/ceph/sample.ceph.conf @@ -776,9 +751,7 @@ mv $RPM_BUILD_ROOT/sbin/mount.fuse.ceph $RPM_BUILD_ROOT/usr/sbin/mount.fuse.ceph #set up placeholder directories mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ceph -%if ! 0%{?_with_systemd} mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/ceph -%endif mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/ceph mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/ceph/tmp mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/ceph/mon @@ -810,12 +783,8 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/ceph-detect-init %{_bindir}/ceph-client-debug %{_bindir}/cephfs -%if 0%{?_with_systemd} %{_unitdir}/ceph-create-keys@.service %{_libexecdir}/systemd/system-preset/50-ceph.preset -%else -%{_initrddir}/ceph -%endif %{_sbindir}/ceph-create-keys %{_sbindir}/rcceph %if 0%{?rhel} >= 7 || 0%{?fedora} || 0%{?suse_version} @@ -863,9 +832,6 @@ rm -rf $RPM_BUILD_ROOT %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-osd %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-mds %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-rgw -%if ! 0%{?_with_systemd} -%attr(770,ceph,ceph) %dir %{_localstatedir}/run/ceph -%endif %post base /sbin/ldconfig @@ -921,9 +887,7 @@ DISABLE_RESTART_ON_UPDATE="yes" %endif %{_bindir}/ceph-post-file %{_bindir}/ceph-brag -%if 0%{?_with_systemd} %{_tmpfilesdir}/ceph-common.conf -%endif %{_mandir}/man8/ceph-authtool.8* %{_mandir}/man8/ceph-conf.8* %{_mandir}/man8/ceph-dencoder.8* @@ -945,11 +909,7 @@ DISABLE_RESTART_ON_UPDATE="yes" %config %{_sysconfdir}/bash_completion.d/rados %config %{_sysconfdir}/bash_completion.d/rbd %config(noreplace) %{_sysconfdir}/ceph/rbdmap -%if 0%{?_with_systemd} %{_unitdir}/rbdmap.service -%else -%{_initrddir}/rbdmap -%endif %{python_sitelib}/ceph_argparse.py* %{python_sitelib}/ceph_daemon.py* %{_udevrulesdir}/50-rbd.rules @@ -978,9 +938,7 @@ fi exit 0 %post common -%if 0%{?_with_systemd} %tmpfiles_create %{_tmpfilesdir}/ceph-common.conf -%endif %postun common # Package removal cleanup @@ -993,12 +951,8 @@ fi %files mds %{_bindir}/ceph-mds %{_mandir}/man8/ceph-mds.8* -%if 0%{?_with_systemd} %{_unitdir}/ceph-mds@.service %{_unitdir}/ceph-mds.target -%else -%{_initrddir}/ceph -%endif %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/mds %post mds @@ -1048,12 +1002,8 @@ fi %{_mandir}/man8/ceph-mon.8* %{_mandir}/man8/ceph-rest-api.8* %{python_sitelib}/ceph_rest_api.py* -%if 0%{?_with_systemd} %{_unitdir}/ceph-mon@.service %{_unitdir}/ceph-mon.target -%else -%{_initrddir}/ceph -%endif %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/mon %post mon @@ -1118,10 +1068,8 @@ fi %defattr(-,root,root,-) %{_bindir}/rbd-mirror %{_mandir}/man8/rbd-mirror.8* -%if 0%{?_with_systemd} %{_unitdir}/ceph-rbd-mirror@.service %{_unitdir}/ceph-rbd-mirror.target -%endif %post -n rbd-mirror %if 0%{?suse_version} @@ -1180,13 +1128,8 @@ fi %{_mandir}/man8/radosgw-admin.8* %config %{_sysconfdir}/bash_completion.d/radosgw-admin %dir %{_localstatedir}/lib/ceph/radosgw -%if 0%{?_with_systemd} %{_unitdir}/ceph-radosgw@.service %{_unitdir}/ceph-radosgw.target -%else -%{_initrddir}/ceph-radosgw -%{_sbindir}/rcceph-radosgw -%endif %post radosgw %if 0%{?suse_version} @@ -1244,13 +1187,9 @@ fi %if 0%{?rhel} && ! 0%{?centos} /etc/cron.hourly/subman %endif -%if 0%{?_with_systemd} %{_unitdir}/ceph-osd@.service %{_unitdir}/ceph-osd.target %{_unitdir}/ceph-disk@.service -%else -%{_initrddir}/ceph -%endif %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd %post osd @@ -1302,18 +1241,10 @@ fi %dir %{_prefix}/lib/ocf %dir %{_prefix}/lib/ocf/resource.d %dir %{_prefix}/lib/ocf/resource.d/ceph -%if 0%{_with_systemd} %exclude %{_prefix}/lib/ocf/resource.d/ceph/ceph %exclude %{_prefix}/lib/ocf/resource.d/ceph/mds %exclude %{_prefix}/lib/ocf/resource.d/ceph/mon %exclude %{_prefix}/lib/ocf/resource.d/ceph/osd -%endif -%if ! 0%{_with_systemd} -%{_prefix}/lib/ocf/resource.d/ceph/ceph -%{_prefix}/lib/ocf/resource.d/ceph/mds -%{_prefix}/lib/ocf/resource.d/ceph/mon -%{_prefix}/lib/ocf/resource.d/ceph/osd -%endif %{_prefix}/lib/ocf/resource.d/ceph/rbd %endif @@ -1544,20 +1475,12 @@ if test "$OLD_POLVER" = "$NEW_POLVER"; then fi # Check whether the daemons are running -%if 0%{?_with_systemd} - /usr/bin/systemctl status ceph.target > /dev/null 2>&1 -%else - /sbin/service ceph status >/dev/null 2>&1 -%endif +/usr/bin/systemctl status ceph.target > /dev/null 2>&1 STATUS=$? # Stop the daemons if they were running if test $STATUS -eq 0; then -%if 0%{?_with_systemd} /usr/bin/systemctl stop ceph.target > /dev/null 2>&1 -%else - /sbin/service ceph stop >/dev/null 2>&1 -%endif fi # Now, relabel the files @@ -1565,11 +1488,7 @@ fi # Start the daemons iff they were running before if test $STATUS -eq 0; then -%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 @@ -1588,20 +1507,12 @@ if [ $1 -eq 0 ]; then fi # Check whether the daemons are running - %if 0%{?_with_systemd} - /usr/bin/systemctl status ceph.target > /dev/null 2>&1 - %else - /sbin/service ceph status >/dev/null 2>&1 - %endif + /usr/bin/systemctl status ceph.target > /dev/null 2>&1 STATUS=$? # Stop the daemons if they were running if test $STATUS -eq 0; then - %if 0%{?_with_systemd} /usr/bin/systemctl stop ceph.target > /dev/null 2>&1 - %else - /sbin/service ceph stop >/dev/null 2>&1 - %endif fi # Now, relabel the files @@ -1609,11 +1520,7 @@ if [ $1 -eq 0 ]; then # Start the daemons if they were running before if test $STATUS -eq 0; then - %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 fi exit 0