Hi Arnoud,

I was on vacation so only saw your post today. I had the very same
problem, and as a result created a patch (attached), which is described
in the attached email I wrote back in April. I never got a response from
Ralf or anyone else, and judging from the lack of reply to your last
post, I would gather that there is no interest in changing this code,
even though it is probably a not uncommon problem on Solaris systems
where legacy use of /usr/ucb is needed.

If you would like to use the patch we developed, feel free to do so.

Dennis

Dennis McRitchie
Computational Science and Engineering Support (CSES)
Academic Services Department
Office of Information Technology
Princeton University

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> [EMAIL PROTECTED]
> Sent: Thursday, August 10, 2006 10:49 AM
> To: openpkg-users@openpkg.org
> Subject: RE: Fixing PATH on Solaris
> 
> It is not there by default. I am asking for /usr/ucb to be 
> added. Maybe I was not clear about that. What the rcPath 
> function does is cut the supplied directories out of the PATH 
> and put them back at the end. So it cuts out /sbin etc. and 
> puts them at the back. But it leaves /usr/ucb in place.
> 
> Why is it putting /bin, /sbin, /usr/bin and /usr/sbin at the 
> back of the PATH anyway? There wouldn't be any problem if it 
> just leaves the old PATH alone and just add the OpenPKG dirs 
> in front of it.
> 
> 
> Regards,
> Arnoud.
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Ralf S. 
> Engelschall
> Sent: 10 August 2006 16:30
> To: openpkg-users@openpkg.org
> Subject: Re: Fixing PATH on Solaris
> 
> 
> On Thu, Aug 10, 2006, [EMAIL PROTECTED] wrote:
> 
> > The rc.openpkg script does some messing around with the 
> PATH variable.
> > On Solaris this results to /bin, /sbin, /usr/bin and /usr/sbin being
> > placed after /usr/ucb. This can give some unexpected 
> results for some
> > commands as the ucb dir contains old BSD versions of some 
> commands (from
> > the olden days when Solaris was still a BSD) and is only there for
> > legacy purposes. This can be fixed by placing /usr/ucb 
> after the list of
> > dirs in line 44 of /etc/rc.d/rc.openpkg:
> >
> >     export PATH
> >     rcPath -a -e PATH         /bin /sbin /usr/bin /usr/sbin /usr/ucb
> >     rcPath -a  PATH         /local/openpkg/bin 
> /local/openpkg/sbin         /local/openpkg/local/bin 
> /local/openpkg/local/sbin
> >
> > I hope this can be fixed in the next release.
> 
> Hmmm... line 44 of rc.openpkg reads...
> 
> |     rcPath -a -e PATH \
> |         /bin /sbin /usr/bin /usr/sbin
> 
> ...and this since years! We _never_ had any "/usr/ucb" there.
> I guess someone changed this file locally at your side.
> You can check this with:
> 
> $ /local/openpkg/bin/openpkg rpm -Vf 
> /local/openpkg/etc/rc.d/rc.openpkg
> 
> It has to be changed locally.
> 
>                                        Ralf S. Engelschall
>                                        [EMAIL PROTECTED]
>                                        www.engelschall.com
> 
> ______________________________________________________________________
> The OpenPKG Project                                    www.openpkg.org
> User Communication List                      openpkg-users@openpkg.org
> 
> 
> ______________________________________________________________________
> The OpenPKG Project                                    www.openpkg.org
> User Communication List                      openpkg-users@openpkg.org
> 
--- Begin Message ---
Hi,

The environment-setting script

eval `$prefix/etc/rc --eval all env`

is very useful, but has one inconvenient side-effect: it insists on
putting certain system directories (e.g., /bin, /usr/bin, etc.) at the
end of the path variable it is modifying (e.g., PATH, MANPATH,
LD_LIBRARY_PATH, INFOPATH), whether these system directories are already
present in the path variable or not.

The rcPath() function in etc/rc.func does check to see if the system
directory is present in the file system, and does not add it if it is
not; but it does no similar check to see if it is present in the path
variable it is modifying.

The net result in our environment is that certain commands will break
after setting the openpkg environment in this fashion. One example: we
also use the Berkeley system library on our systems, but place it after
/usr/bin and /bin, because we don't want to use the Berkeley versions of
commands unless there is no comparable native version. However, after
executing "eval `$prefix/etc/rc --eval all env`" the Berkeley version of
commands becomes the preferred one.

Since I'd like to make sure that I stay in sync with future versions of
OpenPKG, I would prefer to continue to use "eval `$prefix/etc/rc --eval
all env`" rather than write my own environment-setting script from
scratch. So I decided to modify rcPath() such that when the "-e" option
is passed to it, it makes sure that the passed system directory is
*both* present in the file system and *not* present in the path variable
before it adds the system directory to the path variable.

My question is whether you would entertain my submitting this change to
rc.func for inclusion as part of the OpenPKG base package.

Thanks,
       Dennis

Dennis McRitchie
Computational Science and Engineering Support (CSES)
Academic Services Department
Office of Information Technology
Princeton University
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
Developer Communication List                   openpkg-dev@openpkg.org

--- End Message ---

Attachment: rc.func
Description: rc.func

Reply via email to