librelist archives

« back to archive

Homebrew on a multi-admin box

Homebrew on a multi-admin box

From:
Édouard Gilbert
Date:
2011-03-30 @ 12:06
Hi list,

I have several admin users on my laptop.  I’d like to install homebrew 
such that any admin can actually install formulae.  And your argument 
about not having to use sudo to install in /usr/local pretty much 
convinced me.

But, of course, if I chown -R $USER /usr/local, that will do the trick for
only $USER, not for any of the other admin on the box.  It might make more
sense to
chgrp -R admin /usr/local
chmod -R g+w /usr/local
It would be more consistent with your whole argument: after all 
/Applications belongs to root:admin not $USER:$USER. But I guess default 
installation will probably still be by $USER:$USER, except, you know, not 
always the same $USER. Plus /Application/* is a mess any way. Apple seems 
pretty consistent, but other apps are... varied.

So, before I screw everything up, I’d like to know if there is an 
incentive reason why you support chown $USER instead of chgrp, if chgrp 
and chmod are an alternative solution, and if there is some way I could 
ensure consistency within /usr/local (e.g. the sticky bit?).  Or should I 
simply stick with chown $USER and install only using one account?  Or 
perhaps just give up and sudo till the end of time?

Cheers,

Édouard GILBERT
edouard.gilbert@gmail.com

Re: [homebrew] Homebrew on a multi-admin box

From:
Mike McQuaid
Date:
2011-03-30 @ 17:55
On 30 Mar 2011, at 13:06, Édouard Gilbert wrote:
> So, before I screw everything up, I’d like to know if there is an 
incentive reason why you support chown $USER instead of chgrp, if chgrp 
and chmod are an alternative solution, and if there is some way I could 
ensure consistency within /usr/local (e.g. the sticky bit?).  Or should I 
simply stick with chown $USER and install only using one account?  Or 
perhaps just give up and sudo till the end of time?

Using chgrp combined with setting your umask should work ok. What I do is 
just install packages as one user and ssh to the other user over localhost
when I want to install packages as the other.

--
Mike McQuaid
http://mikemcquaid.com

Re: [homebrew] Homebrew on a multi-admin box

From:
Édouard Gilbert
Date:
2011-03-30 @ 20:48
Thanks both of you for the help.  I should’ve looked inside the install 
script, as it actually changed the group of /usr/local to staff (and, 
actually, did not change its owner). Well, I’m still wondering why staff 
and not admin, but that’s a detail.

Now I feel stupid.

Édouard GILBERT
edouard.gilbert@gmail.com

Re: [homebrew] Homebrew on a multi-admin box

From:
Benoit Daloze
Date:
2011-03-30 @ 13:57
On 30 March 2011 14:06, Édouard Gilbert <edouard.gilbert@gmail.com> wrote:

> Hi list,
>
> I have several admin users on my laptop.  I’d like to install homebrew such
> that any admin can actually install formulae.  And your argument about not
> having to use sudo to install in /usr/local pretty much convinced me.
>
> But, of course, if I chown -R $USER /usr/local, that will do the trick for
> only $USER, not for any of the other admin on the box.  It might make more
> sense to
> chgrp -R admin /usr/local
> chmod -R g+w /usr/local
> It would be more consistent with your whole argument: after all
> /Applications belongs to root:admin not $USER:$USER. But I guess default
> installation will probably still be by $USER:$USER, except, you know, not
> always the same $USER. Plus /Application/* is a mess any way. Apple seems
> pretty consistent, but other apps are... varied.
>
> So, before I screw everything up, I’d like to know if there is an incentive
> reason why you support chown $USER instead of chgrp, if chgrp and chmod are
> an alternative solution, and if there is some way I could ensure consistency
> within /usr/local (e.g. the sticky bit?).  Or should I simply stick with
> chown $USER and install only using one account?  Or perhaps just give up and
> sudo till the end of time?
>
> Cheers,
>
> Édouard GILBERT
> edouard.gilbert@gmail.com
>

Hello,

I guess a relatively easy solution would be to use sudo with the -u option.
This would allow you tun run Homebrew as:
$ sudo -u brew_user brew ...
And still have the rights of a normal user.

Hope it helps,
Benoit Daloze