Operating System - HP-UX
1753774 Members
7580 Online
108799 Solutions
New Discussion юеВ

Re: Perform a copy with very limited command availability

 
SOLVED
Go to solution
Bryan Rooney
Frequent Advisor

Re: Perform a copy with very limited command availability

The machine will boot, but not let anyone on. It's gets init to rapidly messages on the console due to programs trying to start and no dld.so library being present. So any higher level command, network commands included (ssh, scp, telnet, ftp, tftp, etc), are not available.

If the solution comes from the shell, it will have to come from the low level commands somehow.
James R. Ferguson
Acclaimed Contributor

Re: Perform a copy with very limited command availability

Hi:

How about :

# /sbin/cat filein > fileout

Regards!

...JRF...
TwoProc
Honored Contributor

Re: Perform a copy with very limited command availability

The closest I've come is:
while read -r c
do
echo $c
done < testfile > testout

However, the danged thing is parsing, and doesn't like binaries...
We are the people our parents warned us about --Jimmy Buffett
larsoncu
Advisor

Re: Perform a copy with very limited command availability

doesn't the /sbin directory have many utilites that aren't dependent on shared libraries. ie when booting, single user mode, etc. /usr isn't mounted.

make sure /sbin is in your PATH and then make sure it is before /usr/bin
Juan M Leon
Trusted Contributor

Re: Perform a copy with very limited command availability

what about ftp to itself then mv. I am not sure if ftp will look for the missing library.
Patrick Wallek
Honored Contributor

Re: Perform a copy with very limited command availability

Yes, the binaries in /sbin are statically linked, so you don't need share libraries.

However, there is no /sbin/cp command. There is however a /sbin/mv command.

So, if you use /sbin/mv to move the /usr/lib/hpux32/dld.so back to its appropriate spot, then all should be OK again.

Note, that you don't have to mess with your PATH environment variable if you just give the full path to the command.
Bryan Rooney
Frequent Advisor

Re: Perform a copy with very limited command availability

We have a winner!!!!

James R. Ferguson was the first to suggest the pathing issue with /sbin.
I now feel like a complete heel for not seeing this myself in the first place!
I was able to use the cat command as suggested. Both larsoncu and Patrick Wallek realized the same solution. The path assigned by hpux -is and hpux -lm has /sbin last. I was thinking there was some real crazy shell magic, but I'll take any simple soultion!

Many thanks for everyones help with this.
James R. Ferguson
Acclaimed Contributor

Re: Perform a copy with very limited command availability

Hi Bryan:

>James R. Ferguson was the first to suggest the pathing issue with /sbin

So, do I get a point? :-))

Regards!

...JRF...
Bryan Rooney
Frequent Advisor

Re: Perform a copy with very limited command availability

Yup, just noticed that myself. Points have been assigned.
Bryan Rooney
Frequent Advisor

Re: Perform a copy with very limited command availability

The ${PATH} env var has /sbin last when running hpux -is or hpux -lm, so when /usr was mounted the commands were trying to go through the lib in /usr that was missing. Using full pathing to commands available in /sbin resolved the situation.