Operating System - HP-UX
1841357 Members
1997 Online
110179 Solutions
New Discussion

Re: Workstation boots up in single user mode ?

 
Sailesh Pokal
Occasional Contributor

Workstation boots up in single user mode ?

Hi,
When I startup the workstation, it boots up in single user mode only. The
following message is displayed

INIT: SINGLE USER MODE

INIT: WARNING: Bad shell "/usr/bin/sh" for root.
FIX root ENTRY IN /etc/passwd AND REBOOT !!!

At the command prompt,
#who ( it gives the sh: who: not found.
#who -r ( the same message sh: who: not found.)

When I tried to edit the passwd file using vi in the /etc folder, sh: vi not
found message is displayed.

I can use #cat passwd ( to the see the content of the file).

Is there any other way to edit the passwd file other than vi.

I cannot access sam also. What should i do to fix the problem or only option is
to re-install the os.

Appciate your reply.

Thanks.

Sailesh.
3 REPLIES 3
Rajesh Tt
New Member

Re: Workstation boots up in single user mode ?

Hi sailesh,

The default shell for the super user is /sbin/sh.
The reason is that when the system comes up ,it start
a temporary shell and execcutes all other functions, at this time only the
root file system will be mounted .All other File systems gets mounted after
running /sbin/rc .
So copy /usr/bin/sh to /sbin/sh and change the
shell path in /etc/passwd to /sbin/sh.This will solve this problem.
This happens to the systems installed with /usr
as a separated filesystem.

Rajesh.TT
Bangalore
Terja Lange_1
Frequent Advisor

Re: Workstation boots up in single user mode ?

STOP, DONT DO THE COPY AS SUGGESTED!

If you copy shells over, when you upgrade or patch, it never gets patched.
If you wish to use vi
#/sbin/mount -a
This will mount all the filesystems so that you can
use vi and find it in your search path.

then edit passwd file and change roots shell to
/sbin/sh or even /usr/bin/ksh works
Else

about the only thing left is awk. but I would not recommend it.
If you are inteerested in the commands available to you in single user mode,
Regards

Terja
Shannon Petry
Honored Contributor

Re: Workstation boots up in single user mode ?

I agree with not copying /usr/bin/sh to /sbin/sh, but not the reasoning.

It has always been my assumption that the reason not to copy /usr/bin/sh to /sbin/sh is that the shells differ greatly. Mainly that /sbin/sh is statically linked, and /usr/bin/sh is dynamically linked. At init time, the shell would not be able to find libraries, then not function.

Please correct me if I am wrong!

PS Many New HP Admins make the mistake of changing the root shell. It is OK in SunOS, Irix, and AIX.
Microsoft. When do you want a virus today?