Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

As of Drupal 8 hook_menu_site_status_alter() no longer exists.
The equilavent way of altering the site status in Drupal 8 is by implementing an event subscriber and giving it a priority between 30 and 40
This way you make sure that the _maintenance key is set in the request attributes and the maintenance theme is not invoked yet.

Of course if you dont want to alter the site status, but just to apply custom logic in case the key is TRUE (eg sending an email) your subscriber should fire with a weight smaller than 30

D7

<?php
/**
 * Implements hook_menu_site_status_alter().
 */
function mymodule_menu_site_status_alter(&$menu_site_status, $path) {
  if (
$menu_site_status == MENU_SITE_OFFLINE) {
   
// Do stuff.
 
}
}
?>

D8
In your modules mymodule.services.yml

services:
  mymodule_maintenance_mode_subscriber:
    class: Drupal\mymodule\EventSubscriber\MaintenanceModeSubscriber
    tags:
      - { name: event_subscriber }
<?php
/**
 * @file
 * Contains \Drupal\mymodule\EventSubscriber\MaintenanceModeSubscriber.
 */

namespace Drupal\mymodule\EventSubscriber;

use
Symfony\Component\EventDispatcher\EventSubscriberInterface;
use
Symfony\Component\HttpKernel\Event\GetResponseEvent;
use
Symfony\Component\HttpKernel\KernelEvents;

class
MaintenanceModeSubscriber implements EventSubscriberInterface {

 
/**
   * Does something.
   *
   * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
   *   The event to process.
   */
 
public function onKernelRequestMaintenance(GetResponseEvent $event) {
   
$request = $event->getRequest();
    if (
$request->attributes->get('_maintenance') == MENU_SITE_OFFLINE) {
     
// Do stuff.
   
}
  }

 
/**
   * {@inheritdoc}
   */
 
public static function getSubscribedEvents() {
   
$events[KernelEvents::REQUEST][] = array('onKernelRequestMaintenance', 35);
    return
$events;
  }

}
?>
Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done