Maintenance mode is triggered by the variable "maintenance_mode", which is set to 1 when activated.
This is the code present in the System module (system.admin.inc, line 2194).
/**
* Form builder; Configure the site's maintenance status.
*
* @ingroup forms
* @see system_settings_form()
*/
function system_site_maintenance_mode() {
$form['maintenance_mode'] = array(
'#type' => 'checkbox',
'#title' => t('Put site into maintenance mode'),
'#default_value' => variable_get('maintenance_mode', 0),
'#description' => t('When enabled, only users with the "Use the site in maintenance mode" <a href="@permissions-url">permission</a> are able to access your site to perform maintenance; all other visitors see the maintenance mode message configured below. Authorized users can log in directly via the <a href="@user-login">user login</a> page.', array('@permissions-url' => url('admin/people/permissions'), '@user-login' => url('user'))),
);
$form['maintenance_mode_message'] = array(
'#type' => 'textarea',
'#title' => t('Maintenance mode message'),
'#default_value' => variable_get('maintenance_mode_message', t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => variable_get('site_name', 'Drupal')))),
'#description' => t('Message to show visitors when the site is in maintenance mode.')
);
return system_settings_form($form);
}
You can use drush to disable maintenance mode.
drush vset maintenance_mode 0;
drush cc all;
You can also use variable_set('maintenance_mode', 0)
and clear cache afterwards (with a call to cache_clear_all()
).