]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.spec.in: move systemd-tmpfiles stuff to ceph-common
authorNathan Cutler <ncutler@suse.com>
Fri, 2 Oct 2015 21:23:17 +0000 (23:23 +0200)
committerNathan Cutler <ncutler@suse.com>
Tue, 27 Oct 2015 10:24:19 +0000 (11:24 +0100)
Since the ceph user and group are created in the ceph-common
%pre scriptlet, the systemd-tmpfiles --create command needs
to run in that package.

tracker.ceph.com/issues/13346 Fixes: #13346

Signed-off-by: Nathan Cutler <ncutler@suse.com>
(cherry picked from commit 0dd9313628da1385b16fb02169101103aa3d0497)

Conflicts:
ceph.spec.in

ceph.spec.in

index 45819f9055663c144054bc74385b905dabbba75d..1e70b799d69bc9bb84e2e70a82c588316f637227 100644 (file)
@@ -78,12 +78,6 @@ Requires:    util-linux
 Requires:      hdparm
 Requires:      cryptsetup
 Requires(post):        binutils
-# We require this to be present for %%{_tmpfilesdir}
-# systemd package must be installed in build environment for systemd-tmpfiles to work
-%if 0%{?_with_systemd}
-Requires: systemd
-BuildRequires: systemd
-%endif
 %if 0%{with cephfs_java}
 BuildRequires: sharutils
 %endif
@@ -180,6 +174,9 @@ Requires:   python-rados = %{version}-%{release}
 Requires:      python-rbd = %{version}-%{release}
 Requires:      python-cephfs = %{version}-%{release}
 Requires:      python-requests
+%if 0%{?_with_systemd}
+%{?systemd_requires}
+%endif
 %if 0%{?rhel} || 0%{?fedora}
 Requires:  redhat-lsb-core
 %endif
@@ -214,6 +211,9 @@ Summary:    Rados REST gateway
 Group:         Development/Libraries
 Requires:      ceph-common = %{version}-%{release}
 Requires:      librados2 = %{version}-%{release}
+%if 0%{?_with_systemd}
+%{?systemd_requires}
+%endif
 %if 0%{?suse_version}
 BuildRequires: libexpat-devel
 BuildRequires: FastCGI-devel
@@ -573,7 +573,7 @@ install -D src/rbdmap $RPM_BUILD_ROOT%{_sysconfdir}/ceph/rbdmap
   mkdir -p $RPM_BUILD_ROOT/usr/lib/ceph-radosgw/
   install -m 0755 -D src/ceph-radosgw-prestart.sh $RPM_BUILD_ROOT/usr/lib/ceph-radosgw/
   install -m 0755 -D systemd/ceph %{buildroot}/%{_sbindir}/rcceph
-  install -m 0644 -D systemd/ceph.tmpfiles.d $RPM_BUILD_ROOT%{_tmpfilesdir}/%{name}.conf
+  install -m 0644 -D systemd/ceph.tmpfiles.d $RPM_BUILD_ROOT%{_tmpfilesdir}/ceph-common.conf
   install -m 0644 -D systemd/tmpfiles.d_ceph-rgw.conf $RPM_BUILD_ROOT%{_tmpfilesdir}/ceph-radosgw.conf
   install -m 0644 -D systemd/ceph-disk-activate-journal@.service $RPM_BUILD_ROOT%{_unitdir}/ceph-disk-activate-journal@.service
   install -m 0644 -D systemd/ceph-disk-activate@.service $RPM_BUILD_ROOT%{_unitdir}/ceph-disk-activate@.service
@@ -650,7 +650,6 @@ rm -rf $RPM_BUILD_ROOT
 %post
 /sbin/ldconfig
 %if 0%{?_with_systemd}
-  systemd-tmpfiles --create %{_tmpfilesdir}/%{name}.conf
   %if 0%{?suse_version}
     %service_add_post ceph.target
   %endif
@@ -726,7 +725,6 @@ rm -rf $RPM_BUILD_ROOT
 %{_unitdir}/ceph-disk-activate@.service
 %{_unitdir}/ceph-disk-dmcrypt-activate@.service
 %{_unitdir}/ceph.target
-%{_tmpfilesdir}/%{name}.conf
 %else
 %{_initrddir}/ceph
 %endif
@@ -808,6 +806,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_bindir}/rbd
 %{_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*
@@ -833,6 +834,11 @@ rm -rf $RPM_BUILD_ROOT
 %{python_sitelib}/ceph_argparse.py*
 %{_udevrulesdir}/50-rbd.rules
 
+%post -n ceph-common
+%if 0%{?_with_systemd}
+systemd-tmpfiles --create
+%endif
+
 %postun -n ceph-common
 # Package removal cleanup
 if [ "$1" -eq "0" ] ; then