code: def _setup_root_plugins(self):
          
  
          def run_root(_self, command):
              """ Executes a shell command as root.
  
                  `command`
                      Shell command string.
  
                  Returns boolean.
                  """
  
              try:
                  # get lock, so this plugin has exclusive access to command pipe
                  self._rlock.acquire()
  
                  # TODO: log root command for this plugin
                  self._cmd_pipe.send_bytes('\x80'.join(['SHL', command]))
                  res = self._cmd_pipe.recv_bytes()
  
                  if res != 'TRM':  # sentinel value, shutdown
                      return res == 'OK'
  
              except (EOFError, IOError):
                  pass
  
              finally:
                  self._rlock.release()
  
              self.shutdown(skip_hooks=True)
              return False
  
          # inject method into each event plugin
          for plugin in registration.get_registered(event_hooks=True,
                                                    root_access=True):
              plugin.run_root = types.MethodType(run_root, plugin)
docs: Injects a `run_root` method into the registered root event plugins.