On Fri, 24 Oct 2014 08:35:40 +0200 Landry Breuil <lan...@rhaalovely.net> wrote:
> On Fri, Oct 24, 2014 at 02:34:54AM -0400, thev...@openmailbox.org wrote:
> > with SUDO set in /etc/mk.conf:
> >   if make release is run as root it will not proceed.
> >   if run as a regular user it gets further, but fails on permissions.
> > 
> > without SUDO in /etc/mk.conf (and i presume the environment) it works fine.
> > 
> > is there any way around this allowing /etc/mk.conf (which is useful for 
> > ports)?
> > i can always move it temporarily, add it to my automated scripts, but is 
> > there
> > a better way?
> > 
> > 
> > $ cat /etc/mk.conf
> > SUDO=/usr/bin/sudo
> 
> I think (and this is probably somewhere in the docs) you should use sudo -E.
> without it (and if you're not in wsrc) DESTDIR and RELEASEDIR are
> removed. check the default sudoers, and sudo manpage for details.
> 
> Landry.
> 

if you are talking about this:

$ sudo env DESTDIR=/usr/dst RELEASEDIR=/usr/release make release
exec /usr/bin/sudo make distribution-etc-root-var
setenv DESTDIR before doing that!
*** Error 1 in /usr/src/etc (Makefile:77 'distribution-etc-root-var': @false)
*** Error 1 in /usr/src/etc (Makefile:228 'distribution')

that is the reason for this error, since root is not in group wsrc, and sudo
is getting invoked twice, once by me and then again by make.

that command does work without SUDO being set (by mk.conf or otherwise). i was
trying to use sudo to invoke each command for logging, which is non-standard.

however, what is recommended in release(8) and the faq is:

  # cd /usr/src/etc && make release

i was incomplete before, as this also fails:

# cat /etc/mk.conf
SUDO=/usr/bin/sudo
# cd /usr/src/etc/ && make release
setenv DESTDIR before doing that!
*** Error 1 in /usr/src/etc (Makefile:77 'release': @false)


so this results from following the documentation, including the recommendations
in ports(7) that SUDO can be set in /etc/mk.conf.

Reply via email to