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

removes sudo from global installation #1807

Merged
merged 1 commit into from Apr 17, 2013
Merged

Conversation

sclarson
Copy link
Contributor

The /usr/local/bin folder shouldn't require sudo access.

The /usr/local/bin folder should require sudo access.
Seldaek added a commit that referenced this pull request Apr 17, 2013
removes sudo from global installation
@Seldaek Seldaek merged commit 8f619c1 into composer:master Apr 17, 2013
@tristanlins
Copy link
Contributor

@sclarson are you sure?

$ touch /usr/local/bin/foo
touch: cannot touch `/usr/local/bin/foo': Permission denied

Seldaek added a commit that referenced this pull request Apr 17, 2013
@Seldaek
Copy link
Member

Seldaek commented Apr 17, 2013

@tristanlins I think it's one of those platform specific things, I added a n about sudo.

@sclarson
Copy link
Contributor Author

Yes, I'm sure.

Depending on your linux distribution it may not be, but in general it is better to instruct people to use less privilege and possibly add additional steps in case of the error message. Using escalated privilege by default can cause other package managers (homebrew on OSX) to have issues.

I may be wrong, but my viewpoint is that if you're in the situation where it is locked down by default, you're more likely to know what sudo does and know that you need it.

@ghost
Copy link

ghost commented Apr 17, 2013

@sclarson: i've never seen a linux distribution in which /usr/local/bin was available for normal users to write to. so sudo is pretty well a necessity.

@tristanlins
Copy link
Contributor

@sclarson: i've never seen a linux distribution in which /usr/local/bin was available for normal users to write to.

Yes I also not see any distribution allow a regular user to write into /usr/local/bin (and I tried a lot).
/usr/local/bin is for local system wide (=> all users) installation and should only be possible by an admin.
~/bin is for user wide installation and should work on most (not all) distributions out of the box. But can be activated in ~/.profile or ~/.bashrc.

@sclarson
Copy link
Contributor Author

@jrobeson I looked back at our production servers and you're correct. It was my local and some vm's that had that open. I still do prefer assuming not to use sudo unless necessary though as there are a lot of osx users where this is writable by users.

A good alternative may be removing this and adding wording for osx users to not use sudo or to use homebrew to install composer globally.

@discordier
Copy link
Contributor

IMO the advice to use sudo can (should) be omitted entirely as those who are running a server where system wide installation is desired MUST know how to make a binary globally available and how to install it there.
People who do NOT know how to do this are not administrator enough to do it and should use local installations.

I strongly discourage everyone to use sudo without knowing exactly what is happening then, therefore the phrasing in the last commit by @Seldaek should at least be rephrased a little with an explanation. Currently it sounds like: "Hey try this and if it does not work out, simply do it as root, trust us, it won't do any harm." which transports the wrong message, anyone running something as root should be extremely cautious.

On another hand, I already feel people complaining about "why does selfupdate not work for me" etc.
Two sides of the medal.

OTOH: I encourage everyone to install composer in ~/bin vs. system wide, as this is IMO the best way to install anyway.

digitalkaoz pushed a commit to digitalkaoz/composer that referenced this pull request Nov 22, 2013
removes sudo from global installation
digitalkaoz pushed a commit to digitalkaoz/composer that referenced this pull request Nov 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants