Subject: No sudo in mk.conf?
To: None <tech-pkg@netbsd.org>
From: James K. Lowden <jklowden@schemamania.org>
List: tech-pkg
Date: 01/10/2003 18:21:43
Following an earlier hint, I added to mk.conf:

	SU=/usr/pkg/bin/sudo

Well, almost.  For some reason, it doesn't work on the VAX I just set up. 


Here's the end of the output with PKG_DEBUG_LEVEL=2.

+ echo ===> Becoming root@pine.schemamania.org to install
libtool-base-1.4.20010614nb10.
===> Becoming root@pine.schemamania.org to install
libtool-base-1.4.20010614nb10.
+ echo /usr/pkg/bin/sudo - root -c
+ /usr/bin/awk { print $1 }
+ echo -n /usr/pkg/bin/sudo 
/usr/pkg/bin/sudo + /usr/pkg/bin/sudo - root -c cd
/usr/pkgsrc/devel/libtool-base; /usr/bin/env
PATH=/usr/users/home/jklowden/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R
6/bin:/usr/pkg/bin:/usr/pkg/sbin:/usr/games:/usr/local/bin:/usr/local/sbi
n:/sbin:/usr/sbin make  PKG_DEBUG_LEVEL=2  HOST_OSTYPE=NetBSD-1.6-vax
PKG_DEBUG_LEVEL=2 _SRC_TOP_= OPSYS=NetBSD OS_VERSION=1.6
LOWER_OPSYS=netbsd real-su-install 
/usr/pkg/bin/sudo: '-' requires an argument
usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p
prompt]
            [-u username/#uid] -s | <command>
*** Error code 1

It looks to me like "make install" wants to do "su - root cd
/usr/pkg/blah...." but sudo doesn't have compatible arguments.  I worked
around it by pointing SU at this script instead:

#!/bin/sh -x
A=`echo $* |sed 's/- root -c //' `
exec sudo /bin/sh -c "$A"

but I think that may not be the world's most elegant solution.  

--jkl