Start a windows service

 @param [String] service_name name of the service to start
 @param optional [Integer] timeout the minumum number of seconds to wait before timing out
9058
def start(service_name, timeout: DEFAULT_TIMEOUT)
      Puppet.debug _("Starting the %{service_name} service. Timeout set to: %{timeout} seconds") % { service_name: service_name, timeout: timeout }

      valid_initial_states = [
        SERVICE_STOP_PENDING,
        SERVICE_STOPPED,
        SERVICE_START_PENDING
      ]

      transition_service_state(service_name, valid_initial_states, SERVICE_RUNNING, timeout) do |service|
        if StartServiceW(service, 0, FFI::Pointer::NULL) == FFI::WIN32_FALSE
          raise Puppet::Util::Windows::Error, _("Failed to start the service")
        end
      end

      Puppet.debug _("Successfully started the %{service_name} service") % { service_name: service_name }
    end
210315
def start(self, timeout=None):
        
        if not self._ioloop:
            raise RuntimeError('Call get_ioloop() or set_ioloop() first')

        self._ioloop.add_callback(self._running.set)

        if self._ioloop_managed:
            self._run_managed_ioloop()
        else:            #  TODO this seems inconsistent with what the docstring describes
            self._running.set()

        if timeout:
            return self._running.wait(timeout)
732864
def wait_for_close(options={})
      seconds = options[:timeout] || 5
      timeout(seconds) do
        begin
          yield if block_given?
          sleep 0.05
        end until 0 == IsWindow(handle)
      end
    end
183051
def enable(name, **kwargs):
    '''
    
    '''
    if _service_is_upstart(name):
        return _upstart_enable(name)
    executable = _get_service_exec()
    cmd = '{0} -f {1} defaults'.format(executable, name)
    return not __salt__['cmd.retcode'](cmd, python_shell=False)
371784
def wait_for_keyboard(timeout: nil)
      keyboard_timeout = keyboard_wait_timeout(timeout)
      message = "Timed out after #{keyboard_timeout} seconds waiting for the keyboard to appear"
      wait_for(message, timeout: keyboard_timeout) do
        keyboard_visible?
      end
    end
98849
@Synchronized
  final void start(Optional<String> name) {
    if (!this.isStarted) {
      this.startImpl(name);
      this.isStarted = true;
    }
  }
547877
def do_restart_service(self, service):
        
        if not self.has_cluster():
            return None

        if self.service_action(service=service, action="restart"):
            print("%s is being restarted" % (service))
        else:
            print("Error restarting service")
            return None
364291
def service_start(name):
    '''
    
    '''
    r = salt.utils.http.query(DETAILS['url']+'service/start/'+name, decode_type='json', decode=True)
    return r['dict']
720572
def start(self, timeout=None):
        
        if self._running.isSet():
            raise RuntimeError('Server already started')
        self._stopped.clear()
        # Make sure we have an ioloop
        self.ioloop = self._ioloop_manager.get_ioloop()
        self._ioloop_manager.start()
        # Set max_buffer_size to ensure streams are closed
        # if too-large messages are received
        self._tcp_server = tornado.tcpserver.TCPServer(
            self.ioloop, max_buffer_size=self.MAX_MSG_SIZE)
        self._tcp_server.handle_stream = self._handle_stream
        self._server_sock = self._bind_socket(self._bindaddr)
        self._bindaddr = self._server_sock.getsockname()

        self.ioloop.add_callback(self._install)
        if timeout:
            return self._running.wait(timeout)
1099465
def start(cls, name):
        
        if cls.debug:
            print("Timer", name, "started ...")
        cls.timer_start[name] = time.time()
704154
def start(name, runas=None):
    '''
    
    '''
    return prlctl('start', salt.utils.data.decode(name), runas=runas)
648433
def run(cls):
        
        if not all(v is None for v in cls._services.values()):
            cls._set_host_id()
            cls._setup_logging()
            cls._set_process_name()
            cls._set_signal_handlers()
            cls._start_server()
        else:
            cls._logger.error('No services to host')
874578
def start(name):
    '''
    
    '''
    cmd = '/usr/sbin/svcadm enable -s -t {0}'.format(name)
    retcode = __salt__['cmd.retcode'](cmd, python_shell=False)
    if not retcode:
        return True
    if retcode == 3:
        # Return code 3 means there was a problem with the service
        # A common case is being in the 'maintenance' state
        # Attempt a clear and try one more time
        clear_cmd = '/usr/sbin/svcadm clear {0}'.format(name)
        __salt__['cmd.retcode'](clear_cmd, python_shell=False)
        return not __salt__['cmd.retcode'](cmd, python_shell=False)
    return False
572872
function envelope(service_name){

    var anchor = this;

    anchor._is_a = 'bbop-service-envelope';

    // Start the timer.
    anchor._start_time = second_count();

    // Theoretical good result frame.
    anchor._envelope = {
	service: 'n/a',
	status: 'success',
	arguments: {},
	comments: [],
	data: {}
    };

    //
    if( service_name && typeof(service_name) === 'string' ){
	anchor._envelope['service'] = service_name;
    }
}
471185
def start(name):
    '''
    
    '''
    if _service_is_upstart(name):
        cmd = 'start {0}'.format(name)
    else:
        cmd = '/sbin/service {0} start'.format(name)
    return not __salt__['cmd.retcode'](cmd, python_shell=False)
566896
def service_state(service_name)
      state = nil
      open_service(service_name, SC_MANAGER_CONNECT, SERVICE_QUERY_STATUS) do |service|
        query_status(service) do |status|
          state = SERVICE_STATES[status[:dwCurrentState]]
        end
      end
      if state.nil?
        raise Puppet::Error.new(_("Unknown Service state '%{current_state}' for '%{service_name}'") % { current_state: state.to_s, service_name: service_name})
      end
      state
    end
217122
def start(self, on_exit_callback=None):
        
        # TODO: Support params for services by mapping {servicename: {class,
        # params}}?
        for service in self.services.keys():
            self.services[service] = self.services[service]()

        self.server.start(on_exit_callback)