]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.spec.in: distro-conditional groupadd and useradd
authorNathan Cutler <ncutler@suse.com>
Fri, 2 Oct 2015 21:21:02 +0000 (23:21 +0200)
committerNathan Cutler <ncutler@suse.com>
Tue, 6 Oct 2015 12:40:40 +0000 (14:40 +0200)
The -o option to groupadd/useradd is not recognized in SLE12. For
SLE/openSUSE, follow the openSUSE packaging guidelines.

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

index faca93115a4c4e68a45924b47fa11c5693916556..96d715a3f803a770e3831dc6930cb1c7d9a316a0 100644 (file)
@@ -202,6 +202,9 @@ Requires:   python-requests
 %if 0%{?rhel} || 0%{?fedora}
 Requires:      redhat-lsb-core
 %endif
+%if 0%{?suse_version}
+Requires(pre): pwdutils
+%endif
 # python-argparse is only needed in distros with Python 2.6 or lower
 %if (0%{?rhel} && 0%{?rhel} <= 6) || (0%{?suse_version} && 0%{?suse_version} <= 1110)
 Requires:      python-argparse
@@ -875,9 +878,15 @@ CEPH_USER_ID="-u 167"
 # CEPH_GROUP_ID="-g "
 # CEPH_USER_ID="-u "
 # %endif
-
+%if 0%{?rhel} || 0%{?fedora}
 %{_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 || :
+%endif
+%if 0%{?suse_version}
+getent group ceph >/dev/null || groupadd -r ceph
+getent passwd ceph >/dev/null || useradd -r -g ceph -d %{_localstatedir}/lib/ceph -s /sbin/nologin -c "Ceph daemons" ceph
+%endif
+exit 0
 
 %post -n ceph-common
 %if 0%{?_with_systemd}