drupal.sh is a handy tool for triggering actions from the command line. Since drupal.sh is often used to trigger heavy operations, it should not use the page cache, which would output the cached page instead of triggering the operation.

This bug affects the drupalorg module, which has an aggregator_cron menu callback which is invoked with php /var/www/drupal.org/htdocs/scripts/drupal.sh --root /var/www/drupal.org/htdocs http://default/aggregator_cron.

CommentFileSizeAuthor
bootstrap.inc-d6.patch759 bytesdrumm
bootstrap.inc_.patch825 bytesdrumm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dries’s picture

Committed to CVS HEAD and DRUPAL-6. Thanks!

lilou’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Bevan’s picture

Version: 7.x-dev » 6.10
Status: Closed (fixed) » Needs work

This results in the following error; PHP Notice: Undefined index: SERVER_SOFTWARE in [redacted]/includes/bootstrap.inc on line 564 if $_SERVER['SERVER_SOFTWARE'] is not set. I have not tested Drupal 7/head.

drumm’s picture

Bevan- are you using a web server or CLI?

Bevan’s picture

Oops – Sorry. CLI on OpenWall Linux (A highly secured distro of linux). Running cron through the web browser works fine – however Cron is run from the command line by calling the php binary.

drumm’s picture

That makes sense, drupal.sh sets $_SERVER['SERVER_SOFTWARE'] itself. There is probably a security policy against that sort of thing. Is there any chance a system-level configuration could set $_SERVER['SERVER_SOFTWARE']?

Bevan’s picture

This is now beyond my knowledge and skills. I've referred this to other Drupal+OWL users though. Bevan/

drumm’s picture

Looks like that also comes from an environment variable. Try:

$ export SERVER_SOFTWARE=PHP CLI
$ {run cron.php as usual}
Bevan’s picture

That works.

Bevan’s picture

What is the solution for this? Shouldn't drupal be checking for isset($_SERVER['SERVER_SOFTWARE']) before testing $_SERVER['SERVER_SOFTWARE'] == 'PHP CLI', as per E_ALL-compliance code standards?

If !isset($_SERVER['SERVER_SOFTWARE']), should drupal assume CLI?

Also it appears that the "Introductory text" on Write E_ALL compliant code is now out of date. I removed it. Please revert if I am incorrect.

drumm’s picture

Assigned: drumm » Unassigned

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.