NetBSD Problem Report #8250

Received: (qmail 11270 invoked from network); 21 Aug 1999 22:01:23 -0000
Message-Id: <199908212200.AAA01628@hiro.xon.net>
Date: Sun, 22 Aug 1999 00:00:24 +0200 (CEST)
From: wiz@danbala.ifoer.tuwien.ac.at
Reply-To: wiz@danbala.ifoer.tuwien.ac.at
To: gnats-bugs@gnats.netbsd.org
Subject: chown not found
X-Send-Pr-Version: 3.95

>Number:         8250
>Category:       pkg
>Synopsis:       chown not found
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    fredb
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 21 15:05:01 +0000 1999
>Closed-Date:    Fri Oct 01 16:01:01 +0000 1999
>Last-Modified:  Fri Oct 01 16:10:56 +0000 1999
>Originator:     Wiz
>Release:        NetBSD 1.4/i386 release, pkgsrc is current (sup-time-stamp 935266710, ca. 1999-08-21)
>Organization:

>Environment:

System: NetBSD hiro.xon.net 1.4 NetBSD 1.4 (HIRO) #20: Thu Jul 29 14:35:21 CEST 1999 wiz@hiro.xon.net:/usr/src/sys/arch/i386/compile/HIRO i386


>Description:
When installing (make install) some packages, e.g. pkg_install-19990819,
I often get the error message `chown: not found'. Sample output from
my last try:

wiz@hiro:/usr/pkgsrc/pkgtools/pkg_install> make install
===>  Installing for pkg_install-19990819
===>  Becoming root@hiro.xon.net to install pkg_install-19990819.
/usr/bin/su Password:
install ===> lib
install ===> add
install   -c -s -o root  -g wheel -m 555 pkg_add /usr/sbin/pkg_add
gzip -cf /usr/pkgsrc/pkgtools/pkg_install/work/pkg_install/add/pkg_add.1 > /usr/share/man/man1/pkg_add.1.gz
chown: not found
*** Error code 127

Stop.
*** Error code 1

and some more lines `*** Error Code 1' (in total: 6, 1 with code 127
and then 5 with code 1).
>How-To-Repeat:
cd /usr/pkgsrc/pkgtools/pkg_install
make
make install
<enter root passwd>

>Fix:
Workaround:
make -i install
This doesn't fix the error codes, but at least installs the program.
>Release-Note:
>Audit-Trail:

From: Hubert Feyrer <feyrer@rfhs8012.fh-regensburg.de>
To: wiz@danbala.ifoer.tuwien.ac.at
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/8250: chown not found
Date: Sun, 22 Aug 1999 01:23:48 +0200 (MET DST)

 On Sun, 22 Aug 1999 wiz@danbala.ifoer.tuwien.ac.at wrote:
 > When installing (make install) some packages, e.g. pkg_install-19990819,
 > I often get the error message `chown: not found'. Sample output from
 > my last try:
 <snip>

 The only place we call chown from is from pkg_add (without a path)... do
 you have /bin in your $PATH?


  - Hubert

 -- 
 NetBSD - Better for your uptime than Viagra


From: Frederick Bruckman <fb@enteract.com>
To: wiz@danbala.ifoer.tuwien.ac.at
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/8250: chown not found
Date: Sun, 22 Aug 1999 06:13:24 -0500 (CDT)

 On Sun, 22 Aug 1999 wiz@danbala.ifoer.tuwien.ac.at wrote:

 > 
 > >Number:         8250
 > >Category:       pkg
 > >Synopsis:       chown not found

 > wiz@hiro:/usr/pkgsrc/pkgtools/pkg_install> make install
 > ===>  Installing for pkg_install-19990819
 > ===>  Becoming root@hiro.xon.net to install pkg_install-19990819.
 > /usr/bin/su Password:
 > install ===> lib
 > install ===> add
 > install   -c -s -o root  -g wheel -m 555 pkg_add /usr/sbin/pkg_add
 > gzip -cf /usr/pkgsrc/pkgtools/pkg_install/work/pkg_install/add/pkg_add.1 > /usr/share/man/man1/pkg_add.1.gz
 > chown: not found

 Your root user must not have "/sbin" in its PATH. The default
 /root/.profile starts like this:

 PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/pkg/sbin:/usr/pkg/bin
 PATH=${PATH}:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin
 export PATH

 You must have changed this. Correct?

 The *.pkg.mk files know where to find pkg_add and friends, but pkg_add
 itself uses the vsystem() wrapper for system(), which requires that
 the system path be set correctly.

State-Changed-From-To: open->analyzed 
State-Changed-By: fredb 
State-Changed-When: Sun Aug 22 16:20:15 CDT 1999 
State-Changed-Why:  
The problem is mainly due to use of a non-standard root shell. 


Responsible-Changed-From-To: pkg-manager->fredb 
Responsible-Changed-By: fredb 
Responsible-Changed-When: Sun Aug 22 16:20:15 CDT 1999 
Responsible-Changed-Why:  
I'm engaged in a dialog with the submitter. 

From: Frederick Bruckman <fb@enteract.com>
To: Wiz <wiz@danbala.ifoer.tuwien.ac.at>
Cc: gnats-bugs@gnats.NetBSD.ORG
Subject: Re: pkg/8250: chown not found
Date: Sun, 22 Aug 1999 15:40:23 -0500 (CDT)

 On Sun, 22 Aug 1999, Wiz wrote:

 > > You must have changed this. Correct?
 > 
 > No, but I changed my root shell to bash.
 > But both root and the installing user have /usr/sbin (where chown
 > lives) in their PATHs (it's in .bash_profile), and when I `make
 > install' as root, it works. It also works when I link /usr/sbin/chown
 > to /bin/chown.

 > `su' seems to modify my system path, and I don't know what file it
 > uses...

 This bash documentation says that .bash_profile is only used for login
 shells. In any case, it might be best to avoid such problems
 altogether by overriding the root shell for "pkg_add". Please try
 putting one or more of the following, or some variation thereof, into
 /etc/mk.conf:

 SU_CMD=	${SH} -c "exec ${SU} - root -c"

 or perhaps

 SU_CMD=	bash --rcfile=/root/.profile -c exec\ ${SU}\ -\ root\ -c

 or even

 SU_CMD=	bash --rcfile=/root/.bash_profile -c "exec ${SU} - root -c"


From: Frederick Bruckman <fb@enteract.com>
To: Wiz <wiz@danbala.ifoer.tuwien.ac.at>
Cc: Hubert Feyrer <hubert.feyrer@rz.uni-regensburg.de>,
        gnats-bugs@gnats.NetBSD.ORG
Subject: Re: pkg/8250: chown not found
Date: Mon, 30 Aug 1999 08:18:10 -0500 (CDT)

 Hi,

 Recall that I was struggling with the concept of training "su" to
 preserve your environment and path. I see that the pr is still open.

 Hubert Feyrer committed a patch to 'pkg_add' last week to use absolute
 paths for /sbin/chown &c. It's available in the latest
 pkgtools/pkg_install, or in the NetBSD-1.4-release (sup or cvs, but
 not in 1.4.1). Did that finally fix it for you?

 Take care


From: Frederick Bruckman <fb@enteract.com>
To: Wiz <wiz@danbala.ifoer.tuwien.ac.at>
Cc: gnats-bugs@gnats.NetBSD.ORG
Subject: Re: pkg/8250: chown*:* not found
Date: Wed, 22 Sep 1999 16:55:52 -0500 (CDT)

 On Wed, 22 Sep 1999, Wiz wrote:

 >chown: not found
       ^

 I should have seen this sooner. The above message means that "chown"
 is reporting something is "not found", not that "chown" is not being
 found!

 Not that that helps. Using the /root/.bash_profile and /root/.bashrc
 you supplied, I can't even reproduce the problem. Sorry.


State-Changed-From-To: analyzed->closed 
State-Changed-By: fredb 
State-Changed-When: Fri Oct 1 11:01:01 CDT 1999 
State-Changed-Why:  
It's not clear that this is a bug in the package system at all. 
In any case, the submitter reports that he can work around this 
problem by setting SU_CMD to not invoke a login shell. I.e, in 
/etc/mk.conf: SU_CMD= ${SU} root -c 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.