removes sudo from global installation #1807

Merged
merged 1 commit into from Apr 17, 2013

Projects

None yet

5 participants

Contributor

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

@sclarson sclarson removes sudo from global installation
The /usr/local/bin folder should require sudo access.
f6b39e4
@Seldaek Seldaek merged commit 8f619c1 into composer:master Apr 17, 2013

1 check passed

default The Travis build passed
Details
Contributor

@sclarson are you sure?

$ touch /usr/local/bin/foo
touch: cannot touch `/usr/local/bin/foo': Permission denied
@Seldaek Seldaek added a commit that referenced this pull request Apr 17, 2013
@Seldaek Seldaek Remind people to use sudo, refs #1807 cf6cb35
Owner
Seldaek commented Apr 17, 2013

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

Contributor

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.

Contributor

@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.

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.

Contributor

@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.

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 digitalkaoz pushed a commit to digitalkaoz/composer that referenced this pull request Nov 22, 2013
@Seldaek Seldaek Remind people to use sudo, refs #1807 02a1674
@aminztw aminztw pushed a commit to aminztw/composer that referenced this pull request Jan 1, 2017
@Seldaek Seldaek Remind people to use sudo, refs #1807 ded4d02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment