]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.spec.in: Fixup uid/gid setting
authorBoris Ranto <branto@redhat.com>
Wed, 17 Jun 2015 15:55:59 +0000 (17:55 +0200)
committerSage Weil <sage@redhat.com>
Thu, 27 Aug 2015 00:34:15 +0000 (20:34 -0400)
We need to set the variables in the %pre phase, otherwise they are not properly
evaluated. Also use /sbin/nolongin instead of /bin/false and set the default
uid/gid pair for fedora and rhel (these were already allocated). We can also
use them for older fedora releases as they are guaranteed to be free.

Signed-off-by: Boris Ranto <branto@redhat.com>
ceph.spec.in

index c15e41682b3013f734d10780c555eaaf91a1a4b1..e304ae6bdb952a6b9f0bc1300e6588e01fc9c810 100644 (file)
@@ -37,17 +37,6 @@ restorecon -R /var/log/ceph > /dev/null 2>&1;
 %global _with_systemd 1
 %endif
 
-CEPH_GROUP_ID=""
-CEPH_USER_ID=""
-%if 0%{?rhel} || 0%{?centos} || 0%{?fedora}
-CEPH_GROUP_ID="-g 167"
-CEPH_USER_ID="-u 167"
-%endif
-# %if 0%{?suse_version}
-# CEPH_GROUP_ID="-g "
-# CEPH_USER_ID="-u "
-# %endif
-
 
 #################################################################################
 # common
@@ -661,9 +650,20 @@ mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/ceph/bootstrap-rgw
 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/radosgw
 
 %pre
-%{_sbindir}/groupadd $CEPH_GROUP_ID -o -r ceph 2>/dev/null || :
-%{_sbindir}/useradd -r -o -g ceph $CEPH_USER_ID -s /bin/false -c "Ceph daemons" -d %{_localstatedir}/lib/ceph ceph 2> /dev/null || :
-%{_sbindir}/usermod -g ceph ceph 2>/dev/null || :
+CEPH_GROUP_ID=""
+CEPH_USER_ID=""
+# disabled for now until we have the numbers
+%if 0%{?rhel} || 0%{?centos} || 0%{?fedora}
+CEPH_GROUP_ID="-g 167"
+CEPH_USER_ID="-u 167"
+%endif
+# %if 0%{?suse_version}
+# CEPH_GROUP_ID="-g "
+# CEPH_USER_ID="-u "
+# %endif
+
+%{_sbindir}/groupadd ceph $CEPH_GROUP_ID -o -r 2>/dev/null || :
+%{_sbindir}/useradd ceph $CEPH_USER_ID -o -r -g ceph -s /sbin/nologin -c "Ceph daemons" -d %{_localstatedir}/lib/ceph 2> /dev/null || :
 
 %clean
 rm -rf $RPM_BUILD_ROOT