]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rpm: drop _with_systemd
authorNathan Cutler <ncutler@suse.com>
Sun, 11 Oct 2015 08:02:40 +0000 (10:02 +0200)
committerBoris Ranto <branto@redhat.com>
Fri, 6 May 2016 11:44:15 +0000 (13:44 +0200)
Ceph versions jewel and above only support systemd.

Signed-off-by: Nathan Cutler <ncutler@suse.com>
ceph.spec.in

index 5c79f9fedb8c6c7444f07edf4662c2e43c83b624..1afcaa016d6abef8804f1c2ad11a9fe8a2fc316d 100644 (file)
@@ -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
@@ -130,12 +121,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
@@ -152,9 +141,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
@@ -259,9 +246,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
@@ -677,9 +662,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" \
@@ -732,17 +715,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
@@ -771,9 +746,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
@@ -805,12 +778,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}
@@ -858,9 +827,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
@@ -916,9 +882,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*
@@ -940,11 +904,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
@@ -973,9 +933,7 @@ fi
 exit 0
 
 %post common
-%if 0%{?_with_systemd}
 %tmpfiles_create %{_tmpfilesdir}/ceph-common.conf
-%endif
 
 %postun common
 # Package removal cleanup
@@ -988,12 +946,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
@@ -1043,12 +997,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
@@ -1113,10 +1063,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}
@@ -1175,13 +1123,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}
@@ -1239,13 +1182,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
@@ -1297,18 +1236,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
@@ -1539,20 +1470,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
@@ -1560,11 +1483,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
@@ -1583,20 +1502,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
@@ -1604,11 +1515,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