I have an account, account1.com which is hosted by host1.com ... this is the account I have the problem on.
I recently graduated from Navy OIS, and told all my fellow students they could send me their digital photos and I would post them on a website for everyone to go to. To facilitate making this page, I wrote a Perl script to find all the .jpg files in a certain folder and its subfolders. It then proceeded to make an HTML table with all of the .jpg files displayed in it.
In order to find the files in question, I used the `backticks` method to call the ls function from the shell and store the resuls in a variable called @list .
My script ran the first few times while I was debugging it. Then all of a sudden it stopped working. It would freeze up and not send any more data from the server. I noticed the HTML would stop at a point that was just before the first shell call in the program. It didn't matter if I used `backticks` or the system command, it would stop outputing before that line. (In a way, they were kind of behaving like the exec command). Not only did this happen in this script, but after this happened, all my OTHER scripts that called a shell function, which had previously worked and were untouched since, now froze up just before their shell function calls, too.
I wrote to my hosting companies tech support. They told me it was a script problem (i.e. it's my fault, not theirs).
After leaving it alone for a couple days, I tried it again and it seemed to be functioning again. I tested my script a few more times, then BOOM. It started freezing up again. I was SURE this was not just because of a bug in my script. For one, a bug in ONE script, shouldn't cause OTHER scripts to stop functioning properly. It's been like this for a week now, and has not functioned properly since.
Because I was sure it was not my fault, I decided to run a test. I am the webmaster of another site, account2 , on another hosting company, host2.
I copied some of the .jpg files and the scripts over to the account2 site and ran the scripts. As I expected, my scripts ran FINE there. However, ethically I cannot use this webspace and bandwidth for my personal needs, also aesthetically I don't want to host this page on account2 either.
To illustrate my point, here are the locations of two IDENTICAL scripts:
[account1[...]
[[small]account2[...]
NOTE: The first location WORKS INTERMITTENTLY, which means there is a small chance they could both work when you try them. Right now, however, it's consistently not working and I don't expect it to work in the near future.
The question IS, what kind of problem/misconfiguration on the server could cause this? Is there a runaway process possibly sucking up my account? Do the servers not have enough memory? Is there something not configured right? I'd like to be able to tell the prople that run the server what they can do so I can get this problem fixed, since they apparently have no idea what to do.
Again, these scripts only freeze when doing shell calls, i.e. `backticks` or system and once one script freezes, all the other scripts freeze even if previously working properly. In general, the scripts that don't make shell calls work (though I'm having other problems with them, as illustrated in my next post).
Thanks for any help you can offer.
[edited by: DaveAtIFG at 6:59 pm (utc) on Dec. 27, 2003]
[edit reason] No specifics please [/edit]
To test it, put a simple backtick command (check the time or do a directory list) in a script and run it over and over. If it doesn't hang, the there sounds like something wrong with the script.
Also worthy of a check IMO: Does the shell command inside the backticks make an implicit assumption on what 'the current directory' is? If this is so I'd try explicitly specifying the absolute path of the directory to be listed.
chdir("$mypictures/"); #set this for your pics dir
if(opendir (FILES, $mypictures)) {
while ($file = readdir (FILES)) {
push (@pictures, "$file") if ($file =~ /\.jpg/);
}
}
You can then use the @pictures array to pull out your filenames and add the additional code to format'em.