def command_pre_hook(*args)
      command = args.shift
      method = to_method_name("#{command}_pre_hook")
      if respond_to?(method)
        send(method, *args)
      else
        return true if args.empty?
        if SV_COMMAND_NAMES.include? command
          if service_external? args[0]
            log error_external_service(command, args[0])
            return false;
          end
        end
        true
      end
    end
def command_pre_hook(*args)
      command = args.shift
      method = to_method_name("#{command}_pre_hook")
      if respond_to?(method)
        send(method, *args)
      else
        return true if args.empty?
        if SV_COMMAND_NAMES.include? command
          if service_external? args[0]
            log error_external_service(command, args[0])
            return false;
          end
        end
        true
      end
    end
Below are some basic command hooks that do the right  thing
 when a service is configured as external via [package][service
 If a command has a pre-hook defined we will run it.
 Otherwise, if it is a run-sv command and the service it refers to
 is an external service, we will show an error since we
 can't control external services from here.

 If any pre-hook returns false, it will prevent execution of the command
 and exit the command with exit code 8.