I'm using drush site-install after having generated the settings.php file from a deployment script.

my settings.php file contains a conditional inclusion of the domain bootstrap:

if (!drupal_installation_attempted()){
    include DRUPAL_ROOT . '/sites/all/modules/domain/settings.inc';
}

But the drupal_installation_attempted will return false and the domain bootstrap will be loaded, because drush site-install sets the MAINTENANCE_MODE after having read settings.php.

Why does drush do so?
I think it's related to the fact that my settings.php is already containing database settings.
But shouldn't the MAINTENANCE_MODE be set asap, when calling site-install?

Comments

moshe weitzman’s picture

Seems reasonable. When does MAINTENANCE_MODE get set today? That string does not appear in site-install command at all.

benoit.pointet’s picture

It get set at ./commands/core/drupal/site_install.inc:11
inside the drush_core_site_install_version function.

greg.1.anderson’s picture

Drush loads the settings.php file in drush_core_pre_site_install(), when it calls drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION) (d6) or drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE) (d7).

site_install.inc does not get included until drush_core_site_install(). Seems reasonable to me to move the define('MAINTENANCE_MODE', 'install'); from site_install.inc to drush_core_pre_site_install, just prior to including settings.php.

moshe weitzman’s picture

Status: Active » Fixed

Ah right, thanks. Moved it earlier and committed.

benoit.pointet’s picture

thanks!

Status: Fixed » Closed (fixed)

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

DuaelFr’s picture

Version: 7.x-5.1 » 7.x-5.x-dev
Status: Closed (fixed) » Active

I can't understand why but this does not work anymore.

greg.1.anderson’s picture

Version: 7.x-5.x-dev » 8.x-6.x-dev
Status: Active » Postponed (maintainer needs more info)

Could we get a more specific report than #7? Please test against latest dev, and follow the instructions on the new issue page when describing your symptoms.

greg.1.anderson’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)
Issue tags: +Needs migration

This issue was marked closed (won't fix) because Drush has moved to Github.

If desired, you may copy this bug to our Github project and then post a link here to the new issue. Please also change the status of this issue to closed (duplicate).

Please ask support questions on Drupal Answers.

greg.1.anderson’s picture

Issue summary: View changes

precisions