Skip site navigation (1)Skip section navigation (2)
Date:      26 Sep 2002 09:41:46 -0700
From:      swear@attbi.com (Gary W. Swearingen)
To:        freebsd-ports@freebsd.org
Subject:   Installing ports as non-root user.
Message-ID:  <ws65ws8zzp.5ws@localhost.localdomain>

next in thread | raw e-mail | index | archive | help
(I've tried discussing this on -questions a few times with poor results,
so please excuse me for bothering you here with so much to read.)

It has always given me the creeps to run downloaded installation scripts
(Makefiles, etc) while running as "root" on a system which I've spent
much time trying to secure so people can't run their scripts as root.
Without spending inordinate amounts of times dissecting install scripts
and installing "by hand", I've seem compelled to run these scripts as
root.  People have implied that the ports system has the means to improve
this situation and I had high hopes about it which have turned sour as
I've tried to make it work.

Main Question: Is the ports system designed to make it possible to install
(all?) ports without being "root"?  Now, obviously, there are ports
which one will eventually WANT to run as root or even install as root,
but should I be ABLE to do it as non-root?

Am I nuts in thinking this sort of thing should be feasible?  Or is it
just of matter of the port creators/maintainers being (understandably)
unwilling to patch up the source scripts which insist on doing things 
as root?

People have implied that I just need to change a few env.vars. and
everything should be fine, but it looked like that would be very
messy, so I simply created a new user "local" and gave it ownership
of dir. trees /usr/ports, /usr/local, /var/db/pkg.  I soon learned
to add the /usr/X11R6 and /usr/compat trees too.  Now I'm discovering
that Makefiles insist on doing things as "root" and want to install
stuff to base-OS dirs and I can't find envars in bsd.ports.mk to
override it.  For example, the linux-gtk port seems to ignore 
USE_LINUX_PREFIX and wants to install to /etc and /usr/lib (though
it tries to deinstall from /compat/linux).  And the libwww port
says (lines deleted):

Warning: not superuser, you may get some errors during installation.
Warning: not superuser, can't run mtree.
/bin/sh ../../../libtool  --mode=install /usr/bin/install -c -o root -g wheel libxmltok.la /usr/local/lib/libxmltok.la
/usr/bin/install -c -o root -g wheel .libs/libxmltok.so.1 /usr/local/lib/libxmltok.so.1
install: /usr/local/lib/libxmltok.so.1: chown/chgrp: Operation not permitted

Note that it's trying to install as root:wheel when I'm running as
"local".  I've seen the above problems in other ports too.

Should I consider ports which won't (easily?) install as non-root
to be broken and ask for them to be fixed?  I realize that I can't
expect them to be fixed immediately, but should it be expected at
all that (all?) ports should be able to be installed to non-root 
places as non-root?

Thanks for slogging your way through this long, dense message.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ws65ws8zzp.5ws>