On Sun, Jan 30, 2005, David Suna wrote about "ls doesn't return on /var/www/html": > I have a RedHat 9 system. Everything seems to be working fine. I tried > to do an ls /var/www/html and the command hangs. Doing the same on other > directories is fine. I assume that some process has the directory open > which is why the ls is hanging. I tried restarting httpd but that didn't > help.
On Linux, you cannot hang on a directory listing because some other process is using that directory. The cause has to be something else. Some common causes for ls blocking: 1. The directory has many thousands of files, and while ls is looking at the details of all of them, sorting them, etc., it cannot return. If this is the problem, then waiting enough time will finally give you the results. Also, you'll see the CPU being used (try "top" in another window) by "ls". Is that what you see? Try using "ls" without any parameters (no -l, no -t, no -F, etc.) and see if the results are faster. 2. This directory is mounted remotely, from NFS, Samba, or something of this sort, and the remote server is not responding. You'd probably know if this is the case on your system... 3. Your hard disk is corrupt, and by coincidence it affects the /var/www directory. If that is the case, you'll probably see disk errors in your logs (run dmesg, and look at /var/log/messages). If you have a disk problem, try to check your disk with "fsck" (read its manual first). A general tip on how to figure out what a program is trying to do while it hangs, is to run it with ltrace or strace. Try "ltrace ls", and see if ls gets into some loop, or hangs on a particular function call for a lot of time. If you see something that appears interesting but you don't know what it means, write it here and we'll try to help. > 2. What would cause this to happen? Is this an indication that the system > has been compromised? Every strange occurance could potentially be a sign of compromise, but I don't remember this particular problem as a known sign of compromise. > On a different topic, what is the recommended way for keeping a RedHat 9 > system up to date? Check out http://fedoralegacy.org/ If I'm not mistaken, though, they don't support Redhat 9 any more. You should seriously consider upgrading (to Fedora Core 3, probably). -- Nadav Har'El | Sunday, Jan 30 2005, 20 Shevat 5765 [EMAIL PROTECTED] |----------------------------------------- Phone +972-523-790466, ICQ 13349191 |We are Microsoft. You will be http://nadav.harel.org.il |assimilated. Resistance is futile. ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]