Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running CentOS 6, and lately I'm having trouble with the server not being able to load external data after it's rebooted.

In the PHP configuration, I have fopen URI enabled, and it works, but as soon as I reboot the machine, the page that uses that function is unable to load any data, which persists even days after the machine has been rebooted. The function magically works again if I issue "sudo service httpd restart"

Does anyone have any ideas as to how to fix this?

share|improve this question
    
How are you loading the external data after reboot? Via script in init.d/rc.d ? –  thinice Mar 5 '12 at 21:50
    
The data's loaded by the PHP script on demand. –  Brandon J. Dusseau Mar 5 '12 at 21:59

1 Answer 1

Could just be a timing issue, that when it goes to load the data while booting, some other function is not yet ready that prevents this. Have you checked the logs for errors ? May need to manipulate the order of the start-up scripts.

Quick Google search finds: http://lists.centos.org/pipermail/centos/2005-December/015516.html and http://stackoverflow.com/questions/3164634/centos-init-scripts-dependecies

Little hard to be exact without more info.

share|improve this answer
    
I don't think it's a timing issue, because the script refuses to load data until the service is restarted, even days after the machine has been rebooted. To put it in perspective, the last reboot of the machine was Thursday, and the data could not be loaded until I restarted the service earlier today. I'll add this information to the original question. –  Brandon J. Dusseau Mar 5 '12 at 22:27
1  
What do the logs say ? –  kls Mar 5 '12 at 23:05
    
The PHP/Apache logs say that there's a "Temporary failure in name resolution" for all the external data. –  Brandon J. Dusseau Mar 6 '12 at 0:07
    
Where is the data located ? Symptoms suggest that it doesn't retry after the initial failure, thus you have to restart httpd. Then it is successful and continues to update until the next reboot. Of course that could be wrong, but it's certainly a good place to start. I stand by my first answer. You could try adding the remote server name to the hosts file and see what happens. –  kls Mar 6 '12 at 1:10
    
As I said, it never tries to load the data until someone visits the page. It's not a problem with loading the data, it's a problem with Apache enabling the scripts to load the data in the first place. –  Brandon J. Dusseau Mar 6 '12 at 5:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.