Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpm: prefer UID/GID 167 when creating ceph user/group #8277

Merged
merged 1 commit into from Mar 23, 2016

Conversation

smithfarm
Copy link
Contributor

This change affects openSUSE/SLE only.

http://tracker.ceph.com/issues/15246 Fixes: #15246

Signed-off-by: Nathan Cutler ncutler@suse.com

This change affects openSUSE/SLE only.

http://tracker.ceph.com/issues/15246 Fixes: ceph#15246

Signed-off-by: Nathan Cutler <ncutler@suse.com>
%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 || :
%{_sbindir}/groupadd ceph -g $CEPH_GROUP_ID -o -r 2>/dev/null || :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the "|| :" suffixes here and below necessary? The script unconditionally finishes with exit 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ddiss Good question. @ktdreyer Are they necessary?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, they are necessary. you could have created your own ceph group/user before you installed ceph packages and the groupadd code would then cause the %pre script to fail.

Another alternative: you installed the packages that created the group and then removed and installed them again -- you would hit the same issue. The same will probably apply to upgrades, etc...

Also, afaik, rpm scripts finish on first line that fails.

@liewegas
Copy link
Member

@BRANTO1 mind taking a quick look?

@b-ranto
Copy link
Contributor

b-ranto commented Mar 23, 2016

@liewegas: this change lgtm.

@liewegas liewegas changed the title RPM: prefer UID/GID 167 when creating ceph user/group rpm: prefer UID/GID 167 when creating ceph user/group Mar 23, 2016
@liewegas liewegas merged commit 1aa2fe6 into ceph:master Mar 23, 2016
@smithfarm smithfarm deleted the wip-15246 branch March 23, 2016 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants