Link to home
Start Free TrialLog in
Avatar of yongsing
yongsing

asked on

su command failed ("No directory")

I am trying to set up the environment in Solaris in order to install Oracle. I added a oinstall and dba groups:
 
# /usr/sbin/groupadd oinstall
# /usr/sbin/groupadd dba
 
then created the oracle user:
 
# /usr/sbin/useradd -g oinstall -G dba oracle
 
And I set the passwd for oracle as follows:
 
# passwd -f files oracle
 
But when I try to login as oracle, as follows:
 
su - oracle
 
I got an error "No directory".

Then I tried creating a directory /home/oracle (this was specified in /etc/passwd) using mkdir, but the command failed with "Operation not applicable".
Avatar of Tintin
Tintin

You'll probably have the automounter running.  Do your users use automounted home dirs?  If not, then disable automounter by doing

/etc/init.d/autofs stop
rm /etc/rc2.d/S74autofs

The above is appliable for Solaris <=9

For Solaris 10, do

svcadm disable autofs

Avatar of yongsing

ASKER

What is automounted home dirs?
What if I still want the automounter? I am not sure if I should disable it permanently.

I tried the following to create home directory for oracle user:

# /usr/sbin/useradd -g oinstall -G dba -d /export/home/oracle -m oracle

The home directory was created, but the "su - oracle" command still returns me "No directory!" error.
Maybe there is an error with the directory, here is what to check.

First look in the /etc/passwd file  the line that starts with oracle should have the directory listed in it.

Then try;  cd /export/home/oracle   (make sure to use the directory from /etc/passwd)

If it comes back ad says something like "No such file or directory" then somewhere in the process, the directory was not created

I'm not sure why someone brought up the automounter stuff so early in the discussion, but you are several steps away from checking that.  If you disable it without even knowing if that is the problem, then you may impact other users on the machine.

Let us know the results of this test, and we can give you more advice on the fix.

Good Luck!
Hi,

The directory was created, and I am able to go into it. The /etc/passwd file also has it.
When you do

su - oracle

and it says "no directory"

What does

pwd

say?
ASKER CERTIFIED SOLUTION
Avatar of arthurjb
arthurjb

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Tintin, "pwd" will just print out the current directory that I am in, and it is definitely no /export/home/oracle.

if you do a ;

cd /export/home/oracle

and then do

ls -l

what does it say??
So far I have login as root, and done everything as root.

When I cd to /export/home, and do "ls -l", i have this for oracle directory:

drwxr-xr-x 3 oracle oinstall 512 Jul 11 18:32 oracle

When I cd to /export/home/oracle, and do "ls -l", I have this:

drwxr-xr-x 2 oracle oinstall 512 Jul 11 18:32 Desktop
-rx-r--r-- 1 oracle oinstall 136 Jul 11 18:32 local.cshrc
-rx-r--r-- 1 oracle oinstall 157 Jul 11 18:32 local.login
-rx-r--r-- 1 oracle oinstall 174 Jul 11 18:32 local.profile
Assuming Solaris <=9

do

/etc/init.d/autofs stop
su - oracle
/etc/init.d/autofs start
Could you post the oracle line from /etc/passwd ?

and I should have said "ls -la" in the /export/home/oracle directory.

Thanks
>>Could you post the oracle line from /etc/passwd ?

It has /export/home/oracle as home directory for "oracle".

>> and I should have said "ls -la" in the /export/home/oracle directory.

drwxr-xr-x 3 oracle oinstall 512 Jul 11 18:32 .
drwxr-x--- 4 root   root     512 Jul 11 18:32 ..
-rw-r--r-- 1 oracle oinstall 144 Jul 11 18:32 .profile
drwxr-xr-x 2 oracle oinstall 512 Jul 11 18:32 Desktop
-rw-r--r-- 1 oracle oinstall 136 Jul 11 18:32 local.cshrc
-rw-r--r-- 1 oracle oinstall 157 Jul 11 18:32 local.login
-rw-r--r-- 1 oracle oinstall 174 Jul 11 18:32 local.profile
The command "uname -r" returns "5.10". This is Solaris 10, right?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I did "svcadm disable autofs", and follow by "su - oracle", but I still get the same "No directory!" error.
Hi guys,

Mystery solved. The permission of /export/home is like this: drwxr-x---. When changed to drwxr-xr-x, the "su - oracle" command works!
So you mustn't have any other users on the system, otherwise you would have discovered they all had the same problem.

Any idea of who changed permission on /export/home?
I don't know. It is a server that is supposed to be for development works, but I guess nobody has really come to use it yet.