docs: def _init(sdp_state: SDPState):
      """Initialise the Master Controller Service.
  
      Performs the following actions:
      1. Registers ServiceState objects into the Config Db.
      2. If initialising for the first time (unknown state),
         sets the SDPState to 'init'
      3. Initialises the state of Services, if running for the first time
         (their state == unknown)
      4. Waits some time and sets the Service states to 'on'. This emulates
         waiting for Services to become available.
      5. Once all services are 'on', sets the SDP state to 'standby'.
  
      """
      # Parse command line arguments.
      LOG.info("Initialising: %s", __service_id__)
  
      # FIXME(BMo) There is a bug when SDP or services 'start' in the 'off'
      # state. At the moment it is impossible to transition out of this.
  
      # FIXME(BMo) **Hack** Register all services or if already registered do
      # nothing (this is handled by the ServiceState object).
      _services = [
          "ExecutionControl:AlarmReceiver:1.0.0",
          "ExecutionControl:AlertManager:1.0.0",
          "ExecutionControl:ConfigurationDatabase:5.0.1",
          "ExecutionControl:MasterController:1.3.0",
          "ExecutionControl:ProcessingController:1.2.6",
          "ExecutionControl:ProcessingBlockController:1.3.0",
          "TangoControl:Database:1.0.4",
          "TangoControl:MySQL:1.0.3",
          "TangoControl:SDPMaster:1.2.1",
          "TangoControl:Subarrays:1.2.0",
          "TangoControl:ProcessingBlocks:1.2.0",
          "Platform:Kafka:2.1.1",
          "Platform:Prometheus:1.0.0",
          "Platform:PrometheusPushGateway:0.7.0",
          "Platform:RedisCommander:210.0.0",
          "Platform:Zookeeper:3.4.13"
      ]
      for service_id in _services:
          subsystem, name, version = service_id.split(':')
          ServiceState(subsystem, name, version)
  
      # If the SDP state is 'unknown', mark the SDP state as init.
      # FIXME(BMo) This is not right as we want to allow for recovery from
      # failure without just reinitialising...!? ie. respect the old sate
      # NOTE: If the state is 'off' we will want to reset the database
      # with 'skasip_config_db_init --clear'
      if sdp_state.current_state in ['unknown', 'off']:
          try:
              LOG.info("Setting the SDPState to 'init'")
              sdp_state.update_current_state('init', force=True)
          except ValueError as error:
              LOG.critical('Unable to set the State of SDP to init! %s',
                           str(error))
  
      LOG.info("Updating Service States")
      service_state_list = get_service_state_list()
  
      # FIXME(BMo) **Hack** Mark all Services in the 'unknown' state as
      # initialising.
      for service_state in service_state_list:
          if service_state.current_state in ['unknown', 'off']:
              service_state.update_current_state('init', force=True)
  
      # FIXME(BMo) **Hack** After 'checking' that the services are 'on' set
      # their state on 'on' after a short delay.
      # FIXME(BMo) This check should not be serialised!!! (should be part of the
      # event loop)
      for service_state in service_state_list:
          if service_state.current_state == 'init':
              time.sleep(random.uniform(0, 0.2))
              service_state.update_current_state('on')
  
      # FIXME(BMo): **Hack** Now the all services are on, set the sate of SDP to
      # 'standby'
      # FIXME(BMo) This should also be part of the event loop.
      services_on = [service.current_state == 'on'
                     for service in service_state_list]
      if all(services_on):
          LOG.info('All Services are online!.')
          sdp_state.update_current_state('standby')
      else:
          LOG.critical('Master Controller failed to initialise.')
  
      return service_state_list