Ejemplo n.º 1
0
	def startService(self):
		if self.loop != -1 or self._state == 'started':
			msg(self.name, 'start fail - already started', system='-')

			# Already started
			return

		# State
		self._state = 'starting'

		# Show info
		msg(self.name, 'start', system='-')

		# Cancel stop
		if self._stopCall:
			self._stopCall.cancel()
			self._stopCall = None

			# Call stop
			self._stopDeferred.callback(0)
			self._stopDeferred = None

		Service.startService(self)

		self.loop = 0
		self._state = 'started'

		# Start
		for name, (run, interval) in self._runs.iteritems():
			run.start(interval, now=False)

		# Show info
		msg(self.name, 'started', system='-')
Ejemplo n.º 2
0
 def stopService(self):
     print 'Stop PullRequest service: %s ...' % self.context.name
     Service.stopService(self)
     if self.watchLoop:
         self.watchLoop.stop()
     if self.schedulerLoop:
         self.schedulerLoop.stop()
Ejemplo n.º 3
0
		def s2(code, self=self):
			try:
				if code != 1:
					# Cancel stop
					return

				if not (self._state == 'stopping' and (self._process + self._workers) == 0):
					err(RuntimeError('{0} stop error: state-{1} p{2} w{3}'.format(
						self.name,
						self._state,
						self._process,
						self._workers,
					)))

				self._stopCall = None
				self._stopDeferred = None

				# Inside
				Service.stopService(self)

				self._state = 'stopped'

				# Show info
				msg(self.name, 'stopped', system='-')
			except:
				err()
Ejemplo n.º 4
0
    def startService(self, _reactor=reactor):
        assert not self._already_started, "can start the PullRequest service once"
        self._already_started = True

        Service.startService(self)

        print 'PullRequest service starting: %s ...' % self.context.name

        d = defer.Deferred()
        _reactor.callWhenRunning(d.callback, None)
        yield d

        try:
            from .serviceloops import PullRequestsWatchLoop, SchedulerLoop

            self.watchLoop = PullRequestsWatchLoop(self.context)
            yield self.watchLoop.start()

            self.schedulerLoop = SchedulerLoop(self.context)
            yield self.schedulerLoop.start();
        except:
            f = failure.Failure()
            log.err(f, 'while starting PullRequest service: %s' % self.context.name)
            _reactor.stop()

        log.msg('PullRequest service is running: %s' % self.context.name)
Ejemplo n.º 5
0
 def stopService(self):
     ntasks = len(self._tasks)
     for task in self.iterTasks():
         task.close()
     self._tasks = set()
     Service.stopService(self)
     logger.debug("stopped scheduler (%i tasks killed)" % ntasks)
Ejemplo n.º 6
0
 def startService(self):
     """
     Called when the plugin is started.  If a plugin needs to perform any
     startup tasks, they should override this method (be sure to chain up
     to the parent method) and perform them here.
     """
     Service.startService(self)
Ejemplo n.º 7
0
	def stopService(self):
		if self.running:
			Service.stopService(self)
			log.info("Stopping master heartbeat service...")
			return self._hb.stop()
		else:
			return defer.succeed(None)
Ejemplo n.º 8
0
    def startService(self):
        """
        Make sure that the necessary properties are set on the root Flocker zfs
        storage pool.
        """
        Service.startService(self)

        # These next things are logically part of the storage pool creation
        # process.  Since Flocker itself doesn't yet have any involvement with
        # that process, it's difficult to find a better time/place to set these
        # properties than here - ie, "every time we're about to interact with
        # the storage pool".  In the future it would be better if we could do
        # these things one-off - sometime around when the pool is created or
        # when Flocker is first installed, for example.  Then we could get rid
        # of these operations from this method (which eliminates the motivation
        # for StoragePool being an IService implementation).
        # https://clusterhq.atlassian.net/browse/FLOC-635

        # Set the root dataset to be read only; IService.startService
        # doesn't support Deferred results, and in any case startup can be
        # synchronous with no ill effects.
        _sync_command_error_squashed(
            [b"zfs", b"set", b"readonly=on", self._name], self.logger)

        # If the root dataset is read-only then it's not possible to create
        # mountpoints in it for its child datasets.  Avoid mounting it to avoid
        # this problem.  This should be fine since we don't ever intend to put
        # any actual data into the root dataset.
        _sync_command_error_squashed(
            [b"zfs", b"set", b"canmount=off", self._name], self.logger)
Ejemplo n.º 9
0
 def startService(self):
     Service.startService(self)
     self.configuration.load()
     self.connectionRegistry = \
         ConnectionRegistry( self.createConfiguredDeviceMap())
     self.timer.start(self.updateInterval).addErrback(log.err)
     self.statusIcon.show()
Ejemplo n.º 10
0
Archivo: rpc.py Proyecto: nagius/cxm
	def startService(self):
		Service.startService(self)

		log.info("Starting RPC service...")
		self.cleanSocket(None)
		self._localPort=reactor.listenUNIX(core.cfg['UNIX_PORT'], pb.PBServerFactory(LocalRPC(self._master)))
		self._remotePort=reactor.listenTCP(core.cfg['TCP_PORT'], pb.PBServerFactory(RemoteRPC(self._master)))
Ejemplo n.º 11
0
Archivo: api.py Proyecto: meker12/otter
 def stopService(self):
     """
     Stop the service by calling stored function
     """
     Service.stopService(self)
     if self._stop:
         return self._stop()
Ejemplo n.º 12
0
Archivo: api.py Proyecto: meker12/otter
 def startService(self):
     """
     Start the service by calling stored function
     """
     Service.startService(self)
     if self._start:
         return self._start()
Ejemplo n.º 13
0
 def __init__(self):
     Service.__init__(self)
     self.seq   = -1
     self.freq  = 4000 
     self.mag   = 15.0 
     self.tamb  = 3 
     self.tsky  = self.tamb - 30
Ejemplo n.º 14
0
 def startService(self):
     Service.startService(self)
     self._registered = False
     self._timer_service = TimerService(
         self.check_interval.total_seconds(), self._check_certs)
     self._timer_service.clock = self._clock
     self._timer_service.startService()
Ejemplo n.º 15
0
 def stopService(self):
     Service.stopService(self)
     try:
         self.app.close()
     except Exception:
         logger.error('Error while closing application', exc_info=True)
     self._close_database()
Ejemplo n.º 16
0
    def startService(self):
        Service.startService(self)

        # Now we're ready to build the command lines and actualy add the
        # processes to procmon.  This step must be done prior to setting
        # active to 1
        for processObject, env in self.processObjects:
            name = processObject.getName()
            self.addProcess(
                name,
                processObject.getCommandLine(),
                env=env
            )
            self._extraFDs[name] = processObject.getFileDescriptors()

        self.active = 1
        delay = 0

        if config.MultiProcess.StaggeredStartup.Enabled:
            delay_interval = config.MultiProcess.StaggeredStartup.Interval
        else:
            delay_interval = 0

        for name in self.processes.keys():
            if name.startswith("caldav"):
                when = delay
                delay += delay_interval
            else:
                when = 0
            callLater(when, self.startProcess, name)

        self.consistency = callLater(
            self.consistencyDelay,
            self._checkConsistency
        )
Ejemplo n.º 17
0
 def stopService(self):
     """
     Stop service by stopping the timerservice and disconnecting cass client
     """
     Service.stopService(self)
     d = self._service.stopService()
     return d.addCallback(lambda _: self._client.disconnect())
Ejemplo n.º 18
0
    def startService(self):
        app = self._prov_service.app
        dhcp_request_processing_service = self._dhcp_process_service.dhcp_request_processing_service
        if self._config['general.rest_authentication']:
            credentials = (self._config['general.rest_username'],
                           self._config['general.rest_password'])
            server_resource = new_restricted_server_resource(app, dhcp_request_processing_service, credentials)
            logger.info('Authentication is required for REST API')
        else:
            server_resource = new_server_resource(app, dhcp_request_processing_service)
            logger.warning('No authentication is required for REST API')
        root_resource = Resource()
        root_resource.putChild('provd', server_resource)
        rest_site = Site(root_resource)

        port = self._config['general.rest_port']
        interface = self._config['general.rest_ip']
        if interface == '*':
            interface = ''
        logger.info('Binding HTTP REST API service to "%s:%s"', interface, port)
        if self._config['general.rest_ssl']:
            logger.info('SSL enabled for REST API')
            context_factory = ssl.DefaultOpenSSLContextFactory(self._config['general.rest_ssl_keyfile'],
                                                               self._config['general.rest_ssl_certfile'])
            self._tcp_server = internet.SSLServer(port, rest_site, context_factory, interface=interface)
        else:
            self._tcp_server = internet.TCPServer(port, rest_site, interface=interface)
        self._tcp_server.startService()
        Service.startService(self)
Ejemplo n.º 19
0
    def main(self):
        """Parse arguments and run the script's main function via ``react``."""
        # If e.g. --version is called this may throw a SystemExit, so we
        # always do this first before any side-effecty code is run:
        options = self._parse_options(self.sys_module.argv[1:])

        if self.logging:
            log_writer = eliot_logging_service(
                options.eliot_destination, self._reactor, True
            )
        else:
            log_writer = Service()
        log_writer.startService()

        # XXX: We shouldn't be using this private _reactor API. See
        # https://twistedmatrix.com/trac/ticket/6200 and
        # https://twistedmatrix.com/trac/ticket/7527
        def run_and_log(reactor):
            d = maybeDeferred(self.script.main, reactor, options)

            def got_error(failure):
                if not failure.check(SystemExit):
                    err(failure)
                return failure
            d.addErrback(got_error)
            return d
        try:
            self._react(run_and_log, [], _reactor=self._reactor)
        finally:
            log_writer.stopService()
Ejemplo n.º 20
0
 def startService(self):
     log.info("starting DBase Service")
     yield self.schema()
     self.startTasks()
     # Remainder Service initialization
     Service.startService(self)
     log.info("Database operational.")
Ejemplo n.º 21
0
   def startService(self):
      ## this implementation of startService overrides the original

      if self.running:
         return

      Service.startService(self)
      pingFunc, args, kwargs = self.call

      def pingFail(failure):
         failure.trap(defer.TimeoutError)
         #print 'Call to %s timed out. Calling onTimeout and stopping service.' % (pingFunc.__name__,)
         self.onTimeout()
         self.stopService()

      def sendPing():
         self.ping = defer.Deferred()
         ## the pingFunc is assumed to be a syncronous function that
         ## sends the request along to the client and returns immediately.
         ## TODO: maybe assume that this returns a deferred that is fired when
         ## the response is received?
         pingFunc(*args, **kwargs)
         self.ping.addErrback(pingFail)
         self.ping.setTimeout(self.step - 1) # timeout if no response before next iteration
         return self.ping ## LoopingCall will reschedule as soon as this fires

      self._loop = LoopingCall(sendPing)
      self._loop.start(self.step, now=self.now).addErrback(self._failed)
Ejemplo n.º 22
0
 def stopService(self):
     try:
         file_cache_idxs = MetricCache.getAllFileCaches()
         writeCachedDataPointsWhenStop(file_cache_idxs)
     except Exception as e:
         log.err('write error when stopping service: %s' % e)
     Service.stopService(self)
Ejemplo n.º 23
0
 def startService(self):
     """
     """
     Service.startService(self)
     from twisted.internet import reactor
     logger.debug("performing initial registration")
     for uri,system in self.known.items():
         self.register_system(uri, system)
Ejemplo n.º 24
0
    def startService(self):
        Service.startService(self)

        if self.clock is None:
            from twisted.internet import reactor
            self.clock = reactor

        self._connect()
Ejemplo n.º 25
0
 def startService(self):
     # Pre: hasattr(self._prov_service, 'app')
     self.request_processing = provd.devices.ident.RequestProcessingService(self._prov_service.app)
     request_config_dir = self._config['general.request_config_dir']
     for name in ['info_extractor', 'retriever', 'updater', 'router']:
         setattr(self.request_processing, 'dev_' + name,
                 self._create_processor(request_config_dir, name, self._config['general.' + name]))
     Service.startService(self)
Ejemplo n.º 26
0
 def startService(self):
   if 'signal' in globals().keys():
     log.debug("Installing SIG_IGN for SIGHUP")
     signal.signal(signal.SIGHUP, signal.SIG_IGN)
   Service.startService(self)
   for factory in self.client_factories.values():
     if not factory.started:
       factory.startConnecting()
Ejemplo n.º 27
0
 def stopService(self):
     Service.stopService(self)
     self.ready = False
     self._registered = False
     for d in list(self._waiting):
         d.cancel()
     self._waiting = []
     return self._timer_service.stopService()
Ejemplo n.º 28
0
 def stopService(self):
     """
     Stops the loop that fetches mail.
     """
     if self._loop and self._loop.running is True:
         self._loop.stop()
         self._loop = None
     Service.stopService(self)
Ejemplo n.º 29
0
 def startService(self):
     """
     Start the writer thread.
     """
     Service.startService(self)
     self._thread = threading.Thread(target=self._writer)
     self._thread.start()
     addDestination(self)
Ejemplo n.º 30
0
 def stopService(self):
     Service.stopService(self)
     if self.__ws_port_obj is None:
         raise Exception('Not started, cannot stop')
     # TODO: Does Twisted already have something to bundle up a bunch of ports for shutdown?
     return defer.DeferredList([
         self.__http_port_obj.stopListening(),
         self.__ws_port_obj.stopListening()])
Ejemplo n.º 31
0
 def startService(self):
     self.storage_reload_task.start(60, False)
     self.aggregation_reload_task.start(60, False)
     reactor.addSystemEventTrigger('before', 'shutdown', shutdownModifyUpdateSpeed)
     reactor.callInThread(writeForever)
     Service.startService(self)
Ejemplo n.º 32
0
 def stopService(self):
     self.reload_task.stop()
     Service.stopService(self)
Ejemplo n.º 33
0
    def stopService(self):
        Service.stopService(self)

        self.clearAllTimers()
Ejemplo n.º 34
0
 def startService(self):
     if settings.CARBON_METRIC_INTERVAL > 0:
         self.record_task.start(settings.CARBON_METRIC_INTERVAL, False)
     Service.startService(self)
Ejemplo n.º 35
0
 def test_realService(self):
     """
     Service implements IService.
     """
     myService = Service()
     verifyObject(IService, myService)
Ejemplo n.º 36
0
 def startService(self):
     Service.startService(self)
     for task, interval in self.tasks:
         task.start(interval, now=False)
Ejemplo n.º 37
0
 def stopService(self):
     self.inspector.stop()
     Service.stopService(self)
Ejemplo n.º 38
0
 def stopService(self):
     for task, interval in self.tasks:
         task.stop()
     Service.stopService(self)
Ejemplo n.º 39
0
 def startService(self):
     self.logger.addObserver(self.sentry_log_observer)
     return Service.startService(self)
Ejemplo n.º 40
0
 def stopService(self):
     for dest in self.destinations:
         remove_destination(dest)
     globalLogPublisher.removeObserver(self.twisted_observer)
     self.stdlib_cleanup()
     return Service.stopService(self)
Ejemplo n.º 41
0
 def startService(self):
     self.stdlib_cleanup = _stdlib_logging_to_eliot_configuration(getLogger())
     self.twisted_observer = _TwistedLoggerToEliotObserver()
     globalLogPublisher.addObserver(self.twisted_observer)
     add_destinations(*self.destinations)
     return Service.startService(self)
Ejemplo n.º 42
0
 def _tub_maker(self, overrides):
     return Service()
Ejemplo n.º 43
0
 def stopService(self):
     self.storage_reload_task.stop()
     self.aggregation_reload_task.stop()
     Service.stopService(self)
Ejemplo n.º 44
0
 def startService(self):
     Service.startService(self)
     self.inspector.start()
Ejemplo n.º 45
0
 def stopService(self):
     Service.stopService(self)
     return self.stop_result
Ejemplo n.º 46
0
 def stopService(self):
     if settings.CARBON_METRIC_INTERVAL > 0:
         self.record_task.stop()
     Service.stopService(self)
Ejemplo n.º 47
0
 def startService(self):
     Service.startService(self)
     if self.__ws_port_obj is not None:
         raise Exception('Already started')
     self.__ws_port_obj = strports.listen(self.__ws_port, self.__ws_protocol)
     self.__http_port_obj = strports.listen(self.__http_port, self.__site)
Ejemplo n.º 48
0
 def stopService(self):
     # We don't need to call port.stopListening(), because the reactor
     # shutdown sequence will do that for us.
     Service.stopService(self)
     logging.info("%s stopped with config %s" % (
         self.service_name.capitalize(), self.config.get_config_filename()))
Ejemplo n.º 49
0
class TestHTTPBootResource(MAASTestCase):

    run_tests_with = MAASTwistedRunTest.make_factory(timeout=5)

    def setUp(self):
        super().setUp()
        self.tftp = Service()
        self.tftp.setName("tftp")
        self.tftp.backend = Mock()
        self.tftp.backend.get_reader = Mock()
        self.tftp.setServiceParent(services)

        def teardown():
            if self.tftp:
                self.tftp.disownServiceParent()
                self.tftp = None

        self.addCleanup(teardown)

    def render_GET(self, resource, request):
        result = resource.render_GET(request)
        if isinstance(result, bytes):
            request.write(result)
            request.finish()
            return succeed(None)
        elif result is NOT_DONE_YET:
            if request.finished:
                return succeed(None)
            else:
                return request.notifyFinish()
        else:
            raise ValueError("Unexpected return value: %r" % (result,))

    @inlineCallbacks
    def test_render_GET_503_when_no_tftp_service(self):
        # Remove the fake 'tftp' service.
        self.tftp.disownServiceParent()
        self.tftp = None

        path = factory.make_name("path")
        ip = factory.make_ip_address()
        request = DummyRequest([path.encode("utf-8")])
        request.requestHeaders = Headers(
            {
                "X-Server-Addr": ["192.168.1.1"],
                "X-Server-Port": ["5248"],
                "X-Forwarded-For": [ip],
                "X-Forwarded-Port": ["%s" % factory.pick_port()],
            }
        )

        self.patch(http.log, "info")
        mock_deferLater = self.patch(http, "deferLater")
        mock_deferLater.side_effect = always_succeed_with(None)

        resource = http.HTTPBootResource()
        yield self.render_GET(resource, request)

        self.assertEquals(503, request.responseCode)
        self.assertEquals(
            b"HTTP boot service not ready.", b"".join(request.written)
        )

    @inlineCallbacks
    def test_render_GET_400_when_no_local_addr(self):
        path = factory.make_name("path")
        ip = factory.make_ip_address()
        request = DummyRequest([path.encode("utf-8")])
        request.requestHeaders = Headers(
            {
                "X-Forwarded-For": [ip],
                "X-Forwarded-Port": ["%s" % factory.pick_port()],
            }
        )

        self.patch(http.log, "info")
        mock_deferLater = self.patch(http, "deferLater")
        mock_deferLater.side_effect = always_succeed_with(None)

        resource = http.HTTPBootResource()
        yield self.render_GET(resource, request)

        self.assertEquals(400, request.responseCode)
        self.assertEquals(
            b"Missing X-Server-Addr and X-Forwarded-For HTTP headers.",
            b"".join(request.written),
        )

    @inlineCallbacks
    def test_render_GET_400_when_no_remote_addr(self):
        path = factory.make_name("path")
        request = DummyRequest([path.encode("utf-8")])
        request.requestHeaders = Headers(
            {"X-Server-Addr": ["192.168.1.1"], "X-Server-Port": ["5248"]}
        )

        self.patch(http.log, "info")
        mock_deferLater = self.patch(http, "deferLater")
        mock_deferLater.side_effect = always_succeed_with(None)

        resource = http.HTTPBootResource()
        yield self.render_GET(resource, request)

        self.assertEquals(400, request.responseCode)
        self.assertEquals(
            b"Missing X-Server-Addr and X-Forwarded-For HTTP headers.",
            b"".join(request.written),
        )

    @inlineCallbacks
    def test_render_GET_403_access_violation(self):
        path = factory.make_name("path")
        ip = factory.make_ip_address()
        request = DummyRequest([path.encode("utf-8")])
        request.requestHeaders = Headers(
            {
                "X-Server-Addr": ["192.168.1.1"],
                "X-Server-Port": ["5248"],
                "X-Forwarded-For": [ip],
                "X-Forwarded-Port": ["%s" % factory.pick_port()],
            }
        )

        self.patch(http.log, "info")
        mock_deferLater = self.patch(http, "deferLater")
        mock_deferLater.side_effect = always_succeed_with(None)

        self.tftp.backend.get_reader.return_value = fail(AccessViolation())

        resource = http.HTTPBootResource()
        yield self.render_GET(resource, request)

        self.assertEquals(403, request.responseCode)
        self.assertEquals(b"", b"".join(request.written))

    @inlineCallbacks
    def test_render_GET_404_file_not_found(self):
        path = factory.make_name("path")
        ip = factory.make_ip_address()
        request = DummyRequest([path.encode("utf-8")])
        request.requestHeaders = Headers(
            {
                "X-Server-Addr": ["192.168.1.1"],
                "X-Server-Port": ["5248"],
                "X-Forwarded-For": [ip],
                "X-Forwarded-Port": ["%s" % factory.pick_port()],
            }
        )

        self.patch(http.log, "info")
        mock_deferLater = self.patch(http, "deferLater")
        mock_deferLater.side_effect = always_succeed_with(None)

        self.tftp.backend.get_reader.return_value = fail(FileNotFound(path))

        resource = http.HTTPBootResource()
        yield self.render_GET(resource, request)

        self.assertEquals(404, request.responseCode)
        self.assertEquals(b"", b"".join(request.written))

    @inlineCallbacks
    def test_render_GET_500_server_error(self):
        path = factory.make_name("path")
        ip = factory.make_ip_address()
        request = DummyRequest([path.encode("utf-8")])
        request.requestHeaders = Headers(
            {
                "X-Server-Addr": ["192.168.1.1"],
                "X-Server-Port": ["5248"],
                "X-Forwarded-For": [ip],
                "X-Forwarded-Port": ["%s" % factory.pick_port()],
            }
        )

        self.patch(http.log, "info")
        mock_deferLater = self.patch(http, "deferLater")
        mock_deferLater.side_effect = always_succeed_with(None)

        exc = factory.make_exception("internal error")
        self.tftp.backend.get_reader.return_value = fail(exc)

        resource = http.HTTPBootResource()
        yield self.render_GET(resource, request)

        self.assertEquals(500, request.responseCode)
        self.assertEquals(str(exc).encode("utf-8"), b"".join(request.written))

    @inlineCallbacks
    def test_render_GET_produces_from_reader(self):
        path = factory.make_name("path")
        ip = factory.make_ip_address()
        request = DummyRequest([path.encode("utf-8")])
        request.requestHeaders = Headers(
            {
                "X-Server-Addr": ["192.168.1.1"],
                "X-Server-Port": ["5248"],
                "X-Forwarded-For": [ip],
                "X-Forwarded-Port": ["%s" % factory.pick_port()],
            }
        )

        self.patch(http.log, "info")
        mock_deferLater = self.patch(http, "deferLater")
        mock_deferLater.side_effect = always_succeed_with(None)

        content = factory.make_string(size=100).encode("utf-8")
        reader = BytesReader(content)
        self.tftp.backend.get_reader.return_value = succeed(reader)

        resource = http.HTTPBootResource()
        yield self.render_GET(resource, request)

        self.assertEquals(
            [100], request.responseHeaders.getRawHeaders(b"Content-Length")
        )
        self.assertEquals(content, b"".join(request.written))

    @inlineCallbacks
    def test_render_GET_logs_node_event_with_original_path_ip(self):
        path = factory.make_name("path")
        ip = factory.make_ip_address()
        request = DummyRequest([path.encode("utf-8")])
        request.requestHeaders = Headers(
            {
                "X-Server-Addr": ["192.168.1.1"],
                "X-Server-Port": ["5248"],
                "X-Forwarded-For": [ip],
                "X-Forwarded-Port": ["%s" % factory.pick_port()],
            }
        )

        log_info = self.patch(http.log, "info")
        mock_deferLater = self.patch(http, "deferLater")
        mock_deferLater.side_effect = always_succeed_with(None)

        self.tftp.backend.get_reader.return_value = fail(AccessViolation())

        resource = http.HTTPBootResource()
        yield self.render_GET(resource, request)

        self.assertThat(
            log_info,
            MockCalledOnceWith(
                "{path} requested by {remoteHost}", path=path, remoteHost=ip
            ),
        )
        self.assertThat(
            mock_deferLater,
            MockCalledOnceWith(
                ANY,
                0,
                http.send_node_event_ip_address,
                event_type=EVENT_TYPES.NODE_HTTP_REQUEST,
                ip_address=ip,
                description=path,
            ),
        )
Ejemplo n.º 50
0
 def stopService(self):
     if self.running:
         self.logger.removeObserver(self.sentry_log_observer)
         return self.client.teardown()
     return Service.stopService(self)
Ejemplo n.º 51
0
 def startService(self):
     Service.startService(self)
     if not self._sender._started:
        self._sender.startConnecting()
Ejemplo n.º 52
0
 def stopService(self):
     Service.stopService(self)
     log.msg('Service stopping')
Ejemplo n.º 53
0
 def startService(self):
     Service.startService(self)
     logging.info("%s started with config %s" % (
         self.service_name.capitalize(), self.config.get_config_filename()))
Ejemplo n.º 54
0
 def stopService(self):
     Service.stopService(self)
     self._sender.stopConnecting()
Ejemplo n.º 55
0
 def startService(self):
     self.reload_task.start(60, False)
     reactor.callInThread(writeForever)
     Service.startService(self)
Ejemplo n.º 56
0
 def startService(self):
     self.storage_reload_task.start(60, False)
     self.aggregation_reload_task.start(60, False)
     reactor.callInThread(writeForever)
     Service.startService(self)
Ejemplo n.º 57
0
 def startService(self):
     Service.startService(self)
     now = time.time()
     startDelta = now // self.interval * self.interval + self.interval - now
     self._delayedCall = self.clock.callLater(startDelta,
                                              self._startLooping)
Ejemplo n.º 58
0
 def startService(self):
     Service.startService(self)
Ejemplo n.º 59
0
 def stopService(self):
     Service.stopService(self)
     return self.stopAllClients()
Ejemplo n.º 60
0
 def startService(self):
     """
     Start this service by starting internal TimerService
     """
     Service.startService(self)
     return self._service.startService()