-
Notifications
You must be signed in to change notification settings - Fork 42
Use a more reliable command to check passwordless sudo #36
Conversation
This PR references issue Linuxbrew/brew#764 and Linuxbrew/brew#574 |
Hi, Rex. Thanks for the PR! Before merging it, I'd like to better understand your configuration of |
Hey @sjackman! I was wondering what you meant by your comment in the issue thread, now I understand. The user I have configured on our servers is named
In addition, this is their entry in
In the interest of completeness, this is the exact set of commands used to create the user: ci_user="deploy"
ci_home="/home/${ci_user}"
ssh_dir="${ci_home}/.ssh"
getent group docker || sudo groupadd docker
id -u ${ci_user} &>/dev/null || sudo adduser --disabled-password ${ci_user}
sudo usermod -aG sudo ${ci_user}
sudo usermod -aG docker ${ci_user}
echo "${ci_user} ALL=(ALL) NOPASSWD:ALL" | sudo EDITOR='tee -a' visudo |
What's the undesirable behaviour that you experience before this PR, and how does this PR fix it? |
As I outlined in Linuxbrew/brew#764 I simply cannot install Linuxbrew with a user that has passwordless sudo. The installer performs the |
You've configured sudo to be |
Fair enough @sjackman, I hadn't really looked through that yet. I went ahead and checked it out and (as you already knew) it does seem like there might be a misconfiguration here. I searched StackOverflow and the consensus seems to be that if your passwordless sudo user is matched by multiple declarations in the I logged in as the
So it seems some commands (like I'm taking a deeper look into this to see if I can resolve this the right way as you suggested. My suspicion is that if the hypothesis above is true, simply removing the Update: WELL WHADDYA FREAKIN KNOW. @sjackman I suppose you already knew this but I will give you the satisfaction of hearing (reading?) it anyway: You were right and I was wrong 🥇 😆 It turns out that the hunch above was correct. Removing the
I am going to attempt to install linuxbrew again with this user now that the issue appears to be resolved, and we can go from there. |
Yep, running the installer again worked like a champ and Thanks for your guidance @sjackman |
Cool. Maybe there could be a way in our installer to check for that kind of case and prevent this from happening? |
It seems like there's an opportunity here for a developer experience improvement. My guess is that many people expect this to just work provided the user has sufficient permissions. Tangling with the particulars of sudo configuration can be a deterrent to adoption. One idea could be to support two modes of installation:
Seems like that would be a little cleaner in terms of expectations/permissions. Just my $0.02. |
I'm glad that you were able to sort this out! It sort of does behave like that, except that the system-level installation is When the installer determines that the user has |
Here's some stock text that I post when explaining why we recommend installing in Consider installing Linuxbrew in If it's an option for you, you could open a ticket with your information systems department to ask that they create a The precompiled binary bottles of non-relocatable bottles can only be used if you install in |
Would it make sense to include this information somewhere more visible for Linuxbrew users? This section of the FAQ would be the most semantically adequate location, but it would probably be more visible (and easier to keep in sync with upstream, I suppose) to have a new section under the #Bottles section of the home page, which would be immediately visible here. Thoughts? |
@sjackman Thank you for that explanation, that is much clearer now. I like that approach and agree completely with their reasoning. So I suppose it does come down to what @iMichka noted above: that there could be a way to better detect whether the user has sudo access (and by "better" I suppose I mean "less intrusive"). Conversely, it could be in the user's best interest to do a hard check in this way to ensure they really do have access to sudo and, if not, push them to resolve their configuration issues. @waldyrious Personally my vote is for the FAQ section. |
Linuxbrew/brew is being merged into Homebrew/brew, so we're avoiding making any additional changes to Linuxbrew/brew. Here's the FAQ for Linuxbrew: https://github.com/Linuxbrew/brew/wiki/FAQ#why-install-in-homelinuxbrewlinuxbrew |
this is |
@sjackman That's interesting news that I wasn't expecting. Makes sense, though. Would it basically just be installing Homebrew onto a |
Yep! Follow the discussion over at Linuxbrew/brew#612 |
No description provided.