1825691 Members
3552 Online
109686 Solutions
New Discussion

Re: SAM command problem

 
Ravikanth_2
Advisor

SAM command problem

Hi,

I have HP-9000 E-class server,which has kept idle for some reasion.I don't know how my earlier system administrator configured, but recently when started the server to check.I have observed one thing ie., SAM command is not working with "root" login.But i have one more Login for my application purpuse.If i login with that login and from there i am entering into root user login by using "SU" command then i am able to run SAM command.Even though this user is not belong to root user or group.

Can any body tell me what colud be the problem?

Thanks
System Administrator
15 REPLIES 15
Umapathy S
Honored Contributor

Re: SAM command problem

Ravi,
What you get as output when you try to run SAM. Is /usr/sbin in root's PATH.

HTH,
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
Mark Grant
Honored Contributor

Re: SAM command problem

What actually happens when you try and run SAM?

THe only difference between the two, at least as far as SAM knows, is that logging in as root runs .profile so it would be worth looking into that.

Never preceed any demonstration with anything more predictive than "watch this"
Pete Randall
Outstanding Contributor

Re: SAM command problem

I tend to suspect the PATH, too. The key here is what exactly the failure is when the "SAM command is not working". Do you get command not found or some other error message?


Pete


Pete
Ravikanth_2
Advisor

Re: SAM command problem

Dear Umapathy & Mark,

When i run SAM command from command prompt i am getting the following error

"sh: sam: not found."

for second thing PATH,i haven't seen /usr/sbin path by using "SET" command.

I hope with this input you might understand my problem.

Thanks and regards
System Administrator
Steven E. Protter
Exalted Contributor

Re: SAM command problem

env

Lets see what the environment on this box is. I don't even know the SHELL, the version of HP-UX anything. I've worked with E boxes, but you could be running HP-UX 9.04 or something.

uname -a

Will tell us something about the system.

I'm more useed to root having the SHELL it has now, posix.

Its certain that there is no or little PATH value, but the SHELL might be messed up in /etc/passwd as well.

If it exists on your system, pwck and grpck commands will validate this most important data file.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
john korterman
Honored Contributor

Re: SAM command problem

Hi,

it sounds as if your root user has very little in his PATH - and your "other" user has more; when you make your first login as the "other" user, I assume that some variables are set and exported, e.g. PATH.
If you then change user to root in a way that does not overwrite the variables set in the first users shell, you simply take over what is exported from there. This is probably the reason why root cannot find sam when logged in directly.
Please try to execute this:
# echo $PATH
a) when logged in directly as root
b) when logged in as the other user
c) after changing user to root.
A guess is that b) and c) will show more than a).

regards,
John K.
it would be nice if you always got a second chance
Bhuvaneswari Selvaraj
Valued Contributor

Re: SAM command problem

Hi,

I guess the difference lies in the .profile file. The other user that u r using right now, must have set the PATH variable in the .profile.

Try logging in as the root user and at the shell prompt

1)export PATH=$PATH:/usr/sbin and then invoke sam or
2) Invoke sam by giving the full path /user/sbin/sam or
3) In the .profile of the root user, add the line
export PATH=$PATH:/usr/sbin
Then logout and login and then try invoking sam.
Before invoking sam, just give echo $PATH and see whether it actually has /usr/sbin .

Hope this helps.
kumaresan_1
Occasional Advisor

Re: SAM command problem

Hi,


This only PATH problem try to set the PATH through SET command. otherwise match application user .profile with superuser .profile
bye
kumaresan
Ravikanth_2
Advisor

Re: SAM command problem

Hi All,

As per your feed back i am giving some points as follows.

i)the o/p of uname -a is

HP-UX myhp B.10.20 E 9000/826 8-user license

ii)for pwck and grpck commands there is no error regarding root user login

iii)The o/p of #ehco $PATH is

/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/pd/bin:/opt/upgrade/bin:/opt/langtools/bin:/opt/imake/bin:/opt/hparray/bin:/opt/pred/bin:/opt/perf/bin

for the other user $echo $PATH o/p is

/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/pd/bin:/opt/upgrade/bin:/opt/langtools/bin:/bin/imake/bin:/opt/hparray/bin:/opt/pred/bin:/opt/perf/bin:/usr/xmhs/cxa/bin:.:/bin:/usr/bin/:/usr/xmhs/bin:/etc:/usr/fmc/bin:/usr/lib/uucp:

iv)for root user i din't find the .profile file in home directory.But one more file i have named .profile.0209 .

v)I am able to run sam command while in root user login by using /usr/sbin/sam.

As per above please advise me how to go about the problem.

Thanks

System Administrator
Zigor Buruaga
Esteemed Contributor

Re: SAM command problem

Hi,

It looks like "sam" has a symbolic link in somewhere ( and its path is included in the PATH of the other user, but not in root user).
Try to find all "sam" files with "find" command.
Also add "/usr/sbin/" to the PATH of root user.

Hope this helps.
Kind regards,
Zigor
john korterman
Honored Contributor

Re: SAM command problem

Hi again,

it is a bit strange that you do not have a .profile for the root user, but I guess there could be reasons for that. Among other things, the root .profile often holds a line that adds /usr/sbin to the general PATH, e.g. like this:
PATH=/usr/sbin:$PATH

You could try to include only the above line in the .profile for the root user, or alternatively, include "/usr/sbin" in /etc/PATH

regards,
John K.
it would be nice if you always got a second chance
Bhuvaneswari Selvaraj
Valued Contributor

Re: SAM command problem

Did your problem get solved or not?

You can do one of the following
1. Create a .profile file and add the line
export PATH=$PATH:/usr/sbin
then at the prompt type . ./.profile (dot space dot slash dot profile) and then try invoking sam

2. Just export the path variable at the command prompt and invoke sam. export PATH=$PATH:/usr/sbin
Ravikanth_2
Advisor

Re: SAM command problem

Dear all,

As per John's reply,i did the same thing like i have created .profile file in root's home diredtory ie., "/" and set the path for /usr/sbin then i exported same path.After that i have logout and login as root.By using #echo $PATH.The o/p is showing new path ie., /usr/sbin.

Now i am able to run SAM Command without having any error.atlost my problem got solved.
But i am not uderstanding with having .profile file in user's home directory how the PATHs are effecting.

Thanks to every body for advising me to sort out my problem.

Thanks and regards,






System Administrator
john korterman
Honored Contributor

Re: SAM command problem

Hi again,

as Zigor already has indicated, the "additional" PATH of the other user:
:/usr/xmhs/cxa/bin:.:/bin:/usr/bin/:/usr/xmhs/bin:/etc:/usr/fmc/bin:/usr/lib/uucp:

holds somewhere a link to /usr/sbin/sam. You can try to go into each of these directories and check for links.
The far out possibility is that the other user's home dir is/usr/bin (his PATH includes the dot char, meaning look in current directory) - but I hope it is too far out.

regards,
John K.
it would be nice if you always got a second chance
Umapathy S
Honored Contributor

Re: SAM command problem

Ravi,
During login, after authentication is done, the /etc/profile is first executed followed by $HOME/.profile. .profile is used to the environment for a particular user while /etc/profile sets up for all users across the system.

The roots .profile sets /usr/sbin as the first PATH since most of the commands used by root is there and should be executed from /usr/sbin.

HTH,
Umapathy
Arise Awake and Stop NOT till the goal is Reached!