Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

caveats: warn if sbin missing from PATH #38778

Closed
wants to merge 1 commit into from

Conversation

tdsmith
Copy link
Contributor

@tdsmith tdsmith commented Apr 18, 2015

If a formula installs files to sbin, check if it's in the user's path;
warn if it isn't.

Closes #38767.

If a formula installs files to sbin, check if it's in the user's path;
warn if it isn't.
@jacknagel
Copy link
Contributor

ahem #37040 ;)

@tdsmith
Copy link
Contributor Author

tdsmith commented Apr 18, 2015

Hwhoops!

@bfontaine
Copy link
Contributor

Any update here?

@tdsmith tdsmith self-assigned this Apr 4, 2016
@ilovezfs
Copy link
Contributor

ilovezfs commented Apr 9, 2016

I think it would be better to modify any formulae ending up using /usr/local/sbin (because we use --prefix) to use /usr/local/bin instead because /usr/local/sbin is not a standard path. Usually this is the --sbindir= option in configure.

@MikeMcQuaid
Copy link
Member

@ilovezfs Agreed. Feel free to an audit for that.

@DomT4
Copy link
Member

DomT4 commented Apr 9, 2016

I'm still quite 👎 on arbitrarily ramming everything into bin for the sake of it, but ho hum really.

@ilovezfs
Copy link
Contributor

ilovezfs commented Apr 9, 2016

@DomT4 it's not arbitrary. The transplantation of software originally intended to be installed into /usr to /usr/local should be done thoughtfully, not with a blind mapping onto the new prefix's corresponding directories unless they actually make sense. /usr/local/sbin is not part of the FHS, and the --sbindir= option exists so that more precise mappings can be used. If we really wanted to make /usr/local/sbin into "a thing" despite its not being standard, the right thing to do would probably be to create a file /etc/paths.d/homebrew containing the line /usr/local/sbin when Homebrew is originally installed. But that is quite invasive, though really no more so than expecting every user on the system to add a non-standard path to her PATH variable in order for some Homebrew software to be found. In general, relying on the default set of paths in /etc/paths is the right thing to do unless we have a technical, system-administrative, or UI/UX reason not to.

@apjanke apjanke modified the milestone: Clear out Legacy May 3, 2016
@apjanke
Copy link
Contributor

apjanke commented May 3, 2016

Can we do a quick roll call to see if there's consensus on what to do here – should we migrate this to homebrew/brew as a PR, or just close it as "won't do"?

I'm 👎 on this myself: I can see the reason for both warning in caveats or just leaving things alone and assuming the user will know where to find things. I think caveats would be cool if we also included adding sbin to the user's path as part of our installation instructions, like we do with $(brew --prefix)/bin. But I think this will be controversial and turn in to a long drag-out discussion over a minor issue, so would rather just leave things as is.

Definitely 👎 on just moving things in to bin though.

@MikeMcQuaid
Copy link
Member

I think we should move things to bin; sbin is for "superuser" stuff which doesn't really make sense in our context.

@DomT4
Copy link
Member

DomT4 commented May 6, 2016

I think it does in some cases. There's certainly some tools from Homebrew formulae in my sbin that require execution via root to actually function.

I tend to agree with @apjanke's viewpoint on this, but per an earlier comment it's not something that stirs up much passion in me.

@MikeMcQuaid
Copy link
Member

I think it does in some cases. There's certainly some tools from Homebrew formulae in my sbin that require execution via root to actually function.

Yeh, fair point, I think it's probably worth fixing up this stuff for them, then, and opening another issue about stuff that doesn't require root not being in sbin.

@apjanke
Copy link
Contributor

apjanke commented May 6, 2016

Some of it's not necessarily root per se, but a "sysadmin" user or "superuser" WRT Homebrew (not necessarily WRT OS X). Which does make sense in Homebrew's context, even though it's usually the human user's everyday user account. It could be the current user account, or it could be brew or another account for those few people who manage Homebrew as a user different from their main personal account, or actually manage their machines with multiple users. Basically, the user who's owner of the relevant brew --prefix, or members of the owning group.

I also think this touches on deferring to upstream: they're the ones who separated out some of their commands to sbin in the first place, and know that they won't be visible to some users.

@MikeMcQuaid
Copy link
Member

I also think this touches on deferring to upstream: they're the ones who separated out some of their commands to sbin in the first place, and know that they won't be visible to some users.

I think the difference is that our use-case is pretty different to what most upstreams would expect.

@ilovezfs
Copy link
Contributor

ilovezfs commented May 6, 2016

We move the prefix. So the upstream expectation that /usr/sbin is in the PATH goes out the window due to our actions not their intentions.

@MikeMcQuaid
Copy link
Member

Random note that a coworker was confused about this issue yesterday because most Homebrew usage does not require this in your PATH.

@MikeMcQuaid
Copy link
Member

Migrated to an issue in Homebrew/brew#291.

@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installing executables to sbin is confusing if sbin isn't in PATH
7 participants