-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add manageiq user to disk group #435
Conversation
@@ -65,6 +65,7 @@ Requires: cockpit-ws | |||
# Add sub uids/gids for running non-privileged containers | |||
grep manageiq /etc/subuid >/dev/null 2>&1 || /usr/sbin/usermod --add-subuids 100000-165535 manageiq | |||
grep manageiq /etc/subgid >/dev/null 2>&1 || /usr/sbin/usermod --add-subgids 100000-165535 manageiq | |||
/usr/sbin/usermod -a -G disk manageiq |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, very minor, but for future readers, I wonder if it's easier to use the full option names?
/usr/sbin/usermod -a -G disk manageiq | |
/usr/sbin/usermod --append --groups disk manageiq |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check what the command does when the user is already part of the group, if it returns a non-zero exit code that will cause the rpm scriptlet to fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[root@manageiq ~]# groups manageiq
manageiq : manageiq
[root@manageiq ~]# /usr/sbin/usermod --append --groups disk manageiq
[root@manageiq ~]# echo $?
0
[root@manageiq ~]# groups manageiq
manageiq : manageiq disk
[root@manageiq ~]# /usr/sbin/usermod --append --groups disk manageiq
[root@manageiq ~]# echo $?
0
Seems like it returns 0
in either case, might be a good idea to check if it is in the group first though groups manageiq | grep disk >/dev/null 2>&1 || /usr/sbin/usermod ...
just so it is more obvious
b69237b
to
a0da7a8
Compare
Checked commit nasark@a0da7a8 with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint |
Ready for another pass |
Backported to
|
Add manageiq user to disk group (cherry picked from commit 658af63)
Since we run as non-root, this will allow smartstate scans to be run on ISCSI store types
@miq-bot assign @agrare
@miq-bot add_label bug, quinteros/yes?