Operating System - HP-UX
1753717 Members
5008 Online
108799 Solutions
New Discussion

Re: HP-UX 11.31 - Unable to change directories in /cots/oracle and /var/opt/

 
NavyYard
Valued Contributor

HP-UX 11.31 -- Unable to change directories in /cots/oracle and /var/opt/

Hi folks!

 

I have a blade server running hp-ux 11.31.

 

As root or oracle, When I try to cd to /cots/oracle it works, but if I do: cd /cots; and then cd oracle, it says "oracle" file not found.  If I do "cd /cots/oracle", it works.

 

I encounter the same problem in other directories, such as /opt. It works all the time when I have fully qualified path for the directory. 

 

Changing directory does not work if I cd down one directory at a time. 

 

/cots directory is mounted on the lun and /opt is on local internal disk.

 

 I do not see any errors in syslog.log.

 

Any advice will be highly appreciated.

 

Thanks

10 REPLIES 10
Ajin_1
Valued Contributor

Re: HP-UX 11.31 -- Unable to change directories in /cots/oracle and /var/opt/

 
if you have already configured sudo then add one more line in /usr/local/etc/sudoers

Cmnd_Alias CD = /usr/bin/cd

Thanks & Regards
Ajin.S
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Dennis Handly
Acclaimed Contributor

Re: HP-UX 11.31 - Unable to change directories in /cots/oracle and /var/opt/

>if I do: cd /cots and then cd oracle, it says "oracle" file not found.

 

What are the permissions of the two directories?

ll -d /cots /cots/oracle

 

Have you exported CDFILTER and to what value?

 

NavyYard
Valued Contributor

Re: HP-UX 11.31 -- Unable to change directories in /cots/oracle and /var/opt/

Hi!
On /cots permissions are RWXRWXR-X and /app/oracle permissions are RWXRWXRWX
Patrick Wallek
Honored Contributor

Re: HP-UX 11.31 - Unable to change directories in /cots/oracle and /var/opt/

Do you have some strange alias for the 'cd' command?

 

What do the following commands show:

 

# alias cd

# whence -v cd

 

# ls -l /usr/bin/cd

# what /usr/bin/cd

 

What happens if you do the following:

 

# /usr/bin/cd /cots

# /usr/bin/cd oracle

 

 

Dennis Handly
Acclaimed Contributor

Re: HP-UX 11.31 - Unable to change directories in /cots/oracle and /var/opt/

>On /cots permissions are RWXRWXR-X and /app/oracle permissions are RWXRWXRWX

 

Why is one /cots and the other /app?

 

If these are mount points, what is the permission when the filesystem is unmounted?

 

>What happens if you do the following:

># /usr/bin/cd /cots

 

It will do no good to use /usr/bin/cd since that won't change the directory for the shell.  You must use the shell builtin.

The proper command for detecting obscuring aliases and functions is that whence you mentioned.

Or you could just quote it to prevent aliasing:  \cd /cots; \cd ./oracle

Matti_Kurkela
Honored Contributor

Re: HP-UX 11.31 - Unable to change directories in /cots/oracle and /var/opt/

The cd(1) man page says:

----------------

cd exists only as a shell built-in command because a new process is created whenever a command is executed, making cd useless if written and processed as a normal system command. Moreover, different shells provide different implementations of cd as a built-in utility. Features of cd as described here may not be supported by all the shells. Refer to individual shell manual entries for differences.

----------------

Emphasis mine.

 

Yes, HP-UX seems to include /usr/bin/cd... but at least on a 11.23 system I checked, it is just a shell script.

Yet I cannot immediately see any benefit with such a script: if /usr/bin/cd is executed, a new shell process will be started to run the script, and the script will run the shell built-in cd command to change its own current working directory. Then the script will end and the process will die, and the information about the changed working directory will vanish in a puff of logic along with the process. The working directory of the parent process will be unaffected.

 

I guess there might be some special case in which /usr/bin/cd is actually useful. Restricted shells, perhaps?

MK
Dennis Handly
Acclaimed Contributor

Re: HP-UX 11.31 - Unable to change directories in /cots/oracle and /var/opt/

>Emphasis mine.

 

Didn't I just say it wouldn't work.  ;-)

 

>it is just a shell script.

 

Yes, same as ulimit.  It's there but can't change anything, just display.

 

>I guess there might be some special case in which /usr/bin/cd is actually useful.

 

The POSIX standard requires it to be there.

madhucertify
Advisor

Re: HP-UX 11.31 - Unable to change directories in /cots/oracle and /var/opt/

Hi Matti/Dennis

 

I am not sure,but a guess could be problem with shell.

 

is it right to change  the shell for root and oracle user ?

 

Navyyard --> Do this problem common for all user registered in the server  and to all directories ?

 

--Madhu

 

 

 

 

 

Dennis Handly
Acclaimed Contributor

Re: HP-UX 11.31 - Unable to change directories in /cots/oracle and /var/opt/

>a guess could be problem with shell.

 

I doubt it.  But if you use tusc, you could see what system call failed.