1830167 Members
5485 Online
109999 Solutions
New Discussion

changed path won't boot

 
SOLVED
Go to solution
werq
Occasional Contributor

changed path won't boot

I believe I may have change path such that it points to an empty directory. As a result none of the programs would work. I then attempted a reboot as I thought it would clear the paths I set this is the problem now I can't even login. Might anyone out there know how to fix this?

Thank you
8 REPLIES 8
Steven E. Protter
Exalted Contributor
Solution

Re: changed path won't boot

Well its time for a console login fix.

Go to the console.

Log in as root.

Type this command carefully:
PATH=/usr/bin

vi /etc/profile

fix the path, make it match a valid box.

save


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
G. Vrijhoeven
Honored Contributor

Re: changed path won't boot

Hi,

The PATH is set in the /etc/profile and in the users .profile it can be adjusted ore overwritten. What PATH variable did you change?

If it is the .profile only one user is affected. If this is the root user a graphical login can be a way out as well.

HTH,

Gideon
Prashant Zanwar_4
Respected Contributor

Re: changed path won't boot

Try and see if you read remotely or remote commands work for your server.

remsh server date

If this goes through..

you can do

remsh server echo "PATH= >> /etc/profile.

Then try and login
Hope this helps
Prashant
"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
werq
Occasional Contributor

Re: changed path won't boot

Hi guys thanks for all the help the thing is I am connecting via consol and can't even login I think the reason that the path is so hosed that it can't start the logon program. I'm feeling very screwed.

Thanks all.
Sridhar Bhaskarla
Honored Contributor

Re: changed path won't boot

Hi Werg,

Once you are in single user mode, you can always set path manually.

PATH=/usr/bin:/usr/sbin:/usr/contrib/bin:/usr/lbin

etc and then try.

Make sure your /etc/PATH file is good. If it is not there, then create a default one with all the possible PATHs that you can think of. Once the system is booted, restore it from backups.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Prashant Zanwar_4
Respected Contributor

Re: changed path won't boot

YOU can try first rcp /etc/PATH server:/etc

if it is working.

Otherwise you have to boot in single user mode. And modify your files. /etc/profile & /etc/PATH

Hope you are able to do remsh..r u?

Prashant
"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
Muthukumar_5
Honored Contributor

Re: changed path won't boot

You can enter the system with single user mode there. Check weather /etc/PATH file there as,

ll /etc/PATH

else vi /etc/PATH
/usr/bin:/opt/ansic/bin:/usr/ccs/bin:/usr/contrib/bin

chown to bin:bin
permission 444

-r--r--r-- 1 bin bin 360 Aug 18 19:18 /etc/PATH

On /etc/profile
set

PATH=/usr/bin:/usr/ccs/bin:/usr/contrib/bin

Copy another hp-ux system default /etc/profile to this system. Just copy and vi /etc/profile and paste here.

-r--r--r-- 1 bin bin 2444 Sep 26 15:57 /etc/profile

Do this. if u have issue give that again.

Boot single user mode as,
stop at booting prompt,
boot hpux -is

Easy to suggest when don't know about the problem!
Kent Ostby
Honored Contributor

Re: changed path won't boot

werq --

Boot into single user mode ( hpux -is from ISL> prompt ).

/sbin/mount /usr

/sbin/mount /var

cd /etc
/usr/bin/cp profile profile.mightbebad

/usr/bin/cp /usr/newconfig/etc/profile /etc/profile

Then reboot

best regards,

Kent M. Ostby
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"