From: Boris Ranto Date: Wed, 17 Jun 2015 15:55:59 +0000 (+0200) Subject: ceph.spec.in: Fixup uid/gid setting X-Git-Tag: v9.1.0~294^2~20 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2d4f3a9199bf074706ee01f1069d1036dbd3f206;p=ceph.git ceph.spec.in: Fixup uid/gid setting 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 --- diff --git a/ceph.spec.in b/ceph.spec.in index c15e41682b30..e304ae6bdb95 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -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