Operating System - HP-UX
1834136 Members
2146 Online
110064 Solutions
New Discussion

env exposes strange values!

 
SOLVED
Go to solution
Michael Furnanz
Occasional Contributor

env exposes strange values!

I just did a cold install V1.6, of B.11.22 on an i2000 system. I'm having some troubles which I'll enter in a separate message, but while poking around, noticed the following strange environment variables (showing only the section with strange values):

HOSTTYPE=hp9000s700 <====?
VENDOR=hp
OSTYPE=hpux
MACHTYPE=pa_risc <====?

Here's what I get otherwise:
[2] % uname -a
HP-UX rtrdev01 B.11.22 U ia64 1635350977 unlimited-user license

[3] % model
ia64 Not Available Not Available


There are true when logging in as a user or as root. Not sure where they're being set, if I should worry about them and try to fix them, or what?

Thanks for any help!
Mike
8 REPLIES 8
Michael Tully
Honored Contributor

Re: env exposes strange values!

Don't know much about this version, but have you applied the patch release after the install? Other thing is what happens when using a different shell?
Anyone for a Mutiny ?
Wouter Jagers
Honored Contributor

Re: env exposes strange values!

About the HOSTTYPE var, I have the impression that HPUX tends to just state 9000/700 for any workstation, and 9000/800 for any server.. I wouldn't immediately see this as a problem, but of course I might be wrong.

Can't tell you much about the MACHTYPE, since I haven't seen any Itanium systems yet. However, it might be the same thing, maybe the OS doesn't 'know' the Itaniums on this level yet.

Do try and get to the latest patch level, 'newer' systems get updated more often..

Regards
Wouter
an engineer's aim in a discussion is not to persuade, but to clarify.
Kent Ostby
Honored Contributor

Re: env exposes strange values!

Mike --

These variables do not exist on the 11.22 machine that I have installed here.

They look like they might be compiler variables although I am checking to see if I can find them elsewhere in the code.

Do you have any compilers installed on top of vanilla 11.22 or any other non-core software ?

"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Kent Ostby
Honored Contributor
Solution

Re: env exposes strange values!

Further research:

I doubt that they are set by code owned by HP; at least not kernel or
core commands:

| # find /stand /sbin /usr/bin /usr/lib /etc -type f | while read F
| > do
| > if strings -a $F | grep -e HOSTTYPE -e MACHTYPE
| > then
| > echo FOUND in $F
| > fi
| > done

This finds nothing (try it with HOSTNAME or LOGNAME; pipe done|more).

:
: HOSTTYPE=hp9000s700 <====?

There are commands that return true (1) or false (0) for testing the type of system that we are on.

| $ ls /usr/bin/*9000*
| /usr/bin/hp9000s200 /usr/bin/hp9000s500 /usr/bin/hp9000s800
| /usr/bin/hp9000s300 /usr/bin/hp9000s700
| /usr/bin/hp9000s400 /usr/bin/hp9000s700_8MB

On 11.22:
| $ model; /usr/bin/hp9000s700 ; echo $? ; /usr/bin/hp9000s800 ; echo $?
| ia64 hp server rx5670
| 1
| 1

On 11.11:
| $ model; /usr/bin/hp9000s700 ; echo $? ; /usr/bin/hp9000s800 ; echo $?
| 9000/899/K570
| 1
| 0

On 11.00:
| $ model; /usr/bin/hp9000s700 ; echo $? ; /usr/bin/hp9000s800 ; echo $?
| 9000/770/J200
| 0
| 0
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Michael Furnanz
Occasional Contributor

Re: env exposes strange values!

Yes, I will apply the latest patches-thanks!

Yes, I do have both the ansi C and the C++ compilers installed.

I verified that nothing is returned using the grep of /stand, /sbin, etc. for MACHTYPE or HOSTTYPE.

I get this response to all variants of hp9000s:

# model; /usr/bin/hp9000s700 ; echo $? ; /usr/bin/hp9000s800 ; echo $?
ia64 Not Available Not Available
1
1

I also tried different shells and get consistent results.

At this point, my main concern is MACHTYPE=pa_risc, although I don't know who/what might be referencing this.

Thanks for the help, and update the note if anything changes after applying patches.

Regards,
Mike
Bill Hassell
Honored Contributor

Re: env exposes strange values!

This is VERY likely some inserted code in /etc/profile or a special file that is sourced from /etc/profile. Many vendors (silently) modify /etc/profile to setup environment variables that may be needed by their product. The easiest way to find the problem is to add some debug code to profile such as:

echo "at line $LINENO $(env | grep HOSTTYPE)"

Just insert this statement at line 1 and then at other location in the /etc/profile file. Look for things like:

. /opt/someapplication/bin/setsomevars.sh

and see if HOSTTYPE starts to show up right after that type of line (the . is a source command).


Bill Hassell, sysadmin
Michael Furnanz
Occasional Contributor

Re: env exposes strange values!

Bill;

Thanks for the suggestion. I looked at /etc/profile and there's basically nothing in it, so I did the following and it returned with nothing:

# find / -name "*.*sh" -exec grep MACHTYPE {} \;


At this point, I'm giving up on this and entering another message regarding the bigger problem of not being able to load our product library.

Regards,
Mike
Mike Stroyan
Honored Contributor

Re: env exposes strange values!

Those variables are exported by bash shell.
It looks like you are running a PA-RISC bash shell. The Aries PA-RISC emulation layer lies to PA-RISC executables about what kind of hardware they are running on. Once executables get to a certain age they just can't handle reality. ;-)