Operating System - HP-UX
1822158 Members
4139 Online
109640 Solutions
New Discussion юеВ

ls command is hang when ftp

 
SOLVED
Go to solution
mohdamir
Frequent Advisor

ls command is hang when ftp

Hi gurus,
I tried to ftp to one server. I can login without any problem. Even execute cd command also. But there problem is when I tried to execute ls, it's hang. I tried using Sun Solaris, it can execute ls without issue.

Thanks in advance for your help.
15 REPLIES 15
Steven Schweda
Honored Contributor

Re: ls command is hang when ftp

> I tried to ftp to one server. [...]

Not a useful description of what you did, or
of "one server".

> I tried using Sun Solaris, [...]

For what?
mohdamir
Frequent Advisor

Re: ls command is hang when ftp

Sorry because not elaborate. My server is using HP-UX and named as A. There is one server, which using Sun Solaris, for me to ftp out/in some file. I named it as B. So right now when I try to ftp to server B from server A it works. I can cd to other directories in server B. However when I try to execute ls, it hangs. Then I try to use server C, which running on Sun Solaris to ftp into server B. It works without any problem.

TQ
bullz
Super Advisor

Re: ls command is hang when ftp

There might be sevral reason for it,

as of i know there might be more number of files located, where you run ls commnad,

plz check

additionaly plz check the user ftp access, what kind of access?
Raynald Boucher
Super Advisor
Solution

Re: ls command is hang when ftp

Did you try using "passive".
Laurent Menase
Honored Contributor

Re: ls command is hang when ftp

It can be a buffer cache sizing pb
or kernel memory contention.
TTr
Honored Contributor

Re: ls command is hang when ftp

Usually the ls error happens when the ftp user's home directory is jailed (chroot) on the ftp server. Is this the case with your server?
Steven Schweda
Honored Contributor

Re: ls command is hang when ftp

> Usually the ls error happens [...]

Which ls error is _the_ ls error?

> [...] (chroot) [...]

_That_ ls error is, in my experience, no ls
output, not a hung condition.
Suraj K Sankari
Honored Contributor

Re: ls command is hang when ftp

Hi,

Your ftp user is configure with "chroot" this is what you are getting this error.

Suraj
mohdamir
Frequent Advisor

Re: ls command is hang when ftp

Hi bullz,
Attached is my ftpaccess. I don't think ftpaccess is a reason because I can ftp to other HP-UX machine without any problem.

Hi Raynald,

What is passive? Can you explain it a little bit?

Hi Laurent,
On my HP-UX server or Sun Solaris server?

Hi TTr and Suraj,
But if I use Sun Solaris server to ftp in using the same ftp user, it works. Is it because the chroot also?

Hakki Aydin Ucar
Honored Contributor

Re: ls command is hang when ftp

may be some kind of performance issue;
did you check the the directory you tried to ls by issuing bdf command to see usage percentage ?
Steven Schweda
Honored Contributor

Re: ls command is hang when ftp

> Sorry because not elaborate. [...]

Ok. I read this a few more times. Tell me
if I understand what you're doing.

1. You are running the FTP client program
("ftp") on an HP-UX system ("A"), and
connecting to the FTP server on a Solaris
system ("B").

2. You can get connected (logged in).

3. Simple commands like "cd" work.

4. An "ls" command hangs.

5. If you run the FTP client program on a
some system other than "A", and connect to
the same FTP server, as the same user,
everything works.

General advice:

Actual "uname -a" output from each system
would say more than "HP-UX" or "Solaris".

Showing actual commands with their actual
output would be more helpful than your
description of what you did.

Now, assuming that I understand what's
happening, ...

> [...] Is it because the chroot also?

I'd ignore all that advice about "chroot".
As you can see, the problem is _not_ with
your (Solaris) FTP server.

Questions:

Ok, "ls" hangs. Does "get some_file" also
hang?

Does FTP work from the HP-UX system to
itself?

Is the HP-UX system on the same physical
network as the other system(s), or is there
more network stuff (routers, firewalls, ..)
between the HP-UX system and the other
system(s)?


> Did you try using "passive".

> What is passive?

"man ftp", look for "passive". Normal FTP
uses separate ports for "control" and "data".
Passive FTP uses only the "control" port, so
it often works better when a firewall blocks
communication on the "data" port. Knowing
nothing about your network, I'd say that this
may be the best suggestion you've gotten.


> Attached is my ftpaccess.

No, it's not. But we probably don't need it.

> I don't think ftpaccess is a reason

I agree.

> because I can ftp to other HP-UX machine
> without any problem.

Again, this is not clear. Now you're talking
about using some other HP-UX system as an FTP
_server_? One reason that you're not getting
much good advice here may be that no one
really understands what you're doing.
Clearer explanations might help.
mohdamir
Frequent Advisor

Re: ls command is hang when ftp

Steven,

5. If you run the FTP client program on a
some system other than "A", and connect to
the same FTP server, as the same user,
everything works.

General advice:

Actual "uname -a" output from each system
would say more than "HP-UX" or "Solaris".

Showing actual commands with their actual
output would be more helpful than your
description of what you did.

Ans: Server A:
#uname -a
HP-UX S02CJ091 B.11.31 U ia64 1571896790 unlimited-user license.

Server B:
#uname -a
SunOS 5.10 Generic_127127-11

Server C:
# uname -a
SunOS S34TD109 5.8 Generic_117350-55 sun4u sparc SUNW,Sun-Fire-V440

Now, assuming that I understand what's
happening, ...

> [...] Is it because the chroot also?

I'd ignore all that advice about "chroot".
As you can see, the problem is _not_ with
your (Solaris) FTP server.

Questions:

Ok, "ls" hangs. Does "get some_file" also
hang?

Ans: Yes, it also hang.

Does FTP work from the HP-UX system to
itself?

Ans: Yes

Is the HP-UX system on the same physical
network as the other system(s), or is there
more network stuff (routers, firewalls, ..)
between the HP-UX system and the other
system(s)?

Ans: HP-UX (System A) and Sun Solaris (System C) are in same physical network. But Sun Solaris (System B) is not. It reside in other country.

> Did you try using "passive".

> What is passive?

"man ftp", look for "passive". Normal FTP
uses separate ports for "control" and "data".
Passive FTP uses only the "control" port, so
it often works better when a firewall blocks
communication on the "data" port. Knowing
nothing about your network, I'd say that this
may be the best suggestion you've gotten.

Ans: So i've to ask the Sun Solaris admin to open some ports?

Again, this is not clear. Now you're talking
about using some other HP-UX system as an FTP
_server_? One reason that you're not getting
much good advice here may be that no one
really understands what you're doing.
Clearer explanations might help.

Ans: I'm using the other HP-UX machine (System D if you want to name it) to proof that this error is not because of the chroot or ftpaccess.
Steven Schweda
Honored Contributor

Re: ls command is hang when ftp

> Ok, "ls" hangs. Does "get some_file" also
hang?
>
> Ans: Yes, it also hang.
>
> Does FTP work from the HP-UX system to
itself?
>
> Ans: Yes

To me, that makes it look as if the FTP
server is working correctly, but there's
some firewall somewhere which is blocking the
FTP data channel. "ls" and "get" both do a
data transfer. With active FTP, they both
use the data channel. If that port is
blocked, then that would explain the hanging.

> Ans: So i've to ask the Sun Solaris admin
> to open some ports?

Something like that, or else use passive FTP.
Passive FTP is easy, and you can do it
yourself. I don't know who is blocking the
FTP data channel, so I don't know what to
change to fix it that way.

> [...] proof that this error is not because
> of the chroot or ftpaccess.

Ok. (I never thought that it was.)


> > Did you try using "passive".
>
> > What is passive?
>
> "man ftp", look for "passive". [...]
> Knowing
> nothing about your network, I'd say that this
> may be the best suggestion you've gotten.

As I/we said, try passive FTP, and see if
that helps. It still sounds to me like the
best idea.
mohdamir
Frequent Advisor

Re: ls command is hang when ftp

Thanks Steve and others,

You are the great! I just use:

# ftp -p

That's it.. (^_^)
mohdamir
Frequent Advisor

Re: ls command is hang when ftp

See above comment.
TQ