at koumbit our internal best practise is to create an aegir site node using the canonical site name (e.g. foo.com) with an alias using our local wildcard DNS (e.g. foo.com.sites.koumbit.net) during development. to make a site live we just need to change the appropriate DNS record. however, aegir currently only runs cron.php on the canonical name. but since aegir did exec wget (getting an 302 response), the site node shows that cron was run. there are a few problems here:
* aegir gives a false positive without actually checking the HTTP response code
* cron is never run for our staging sites
* using an external program like wget adds an unnecessary dependency and makes it difficult to extract the HTTP response code and debug other possible cron problems
after talking with anarcat, i suggest that aegir iterate over the site aliases if cron.php returns something other than 200. if none of those work, then the timestamp variable should not be updated, and an error should be logged via watchdog. in order to detect the return code and to avoid the dependency, this should all be done via drupal_http_request().
related issues:
* #1143068: Allow cron.php in nginx configuration so that wget works out of the box
* #1090678: wget cron method broken for d7 sites
Comments
Comment #1
anarcat commentedI just pushed [e7533a5] to 2.x to switch to using drupal_http_request() and update the timestamp only if it works.
I'll test this in staging now and merge it in 1.x if it actually works.
Then we can look at aliases iteration (maybe?)...
Comment #2
anarcat commented531837f602a4803678bed73e1433715710686470 adds feedback in --debug output, seems to work fine in staging, merging in 1.x.
Comment #3
anarcat commentedAlright, patch is merged. Now we need to think about whether or not we want to iterate over all the aliases if the canonical host fails...
Opinions?
Comment #4
anarcat commentedComment #5
mvci vote yes, but wouldn't say it's a high priority.
Comment #6
anarcat commentedI requested feedback also on the community site: http://community.aegirproject.org/discuss/should-we-try-cronphp-aliases-...
Comment #7
cashwilliams commentedI think it should iterate over the aliases, as long as it stops on the first one that works.
Comment #8
omega8cc commentedThis adds some overhead - sometimes serious of you have 30 aliases to check per site. I don't like this idea and vote no.
Instead, if any of your site's name doesn't resolve to the server IP for any reason, you should use the old standard - drush method instead of wget.
Comment #9
j0nathan commentedSubscribing.
Comment #10
steven jones commentedI think we should leave it as is, and mark fixed. Assigning to Anarcat for the decision.
Comment #11
steven jones commentedIf someone wants to work on this, here's a good way to progress this issue:
Comment #12
anarcat commentedSo far the feedback we got here is that we should avoid looping over aliases. It's all stuff that can be worked around anyways, and we got proper feedback on failure now. So I think we should just close this issue now - if someone really wants to do some crazy stuff with cron, it can be done with an external tool. Also consider #1145388: Replace cron (and scheduled tasks) system in 2.x.