ServiceReactor

DIRAC class to execute services

In the most common case, DIRAC services are executed using the dirac-service command. dirac-service accepts a list positional arguments. These arguments have the form: [DIRAC System Name]/[DIRAC Service Name] dirac-service then: - produces a instance of ServiceReactor - loads the required modules using the ServiceReactor.loadAgentModules method - starts the execution loop using the ServiceReactor.serve() method

Service modules must be placed under the Service directory of a DIRAC System. DIRAC Systems are called XXXSystem where XXX is the [DIRAC System Name], and must inherit from the base class RequestHandler

class DIRAC.Core.DISET.ServiceReactor.ReactorStats
__init__()
connectionStablished()
class DIRAC.Core.DISET.ServiceReactor.ServiceReactor

Bases: object

__init__()

x.__init__(…) initializes x; see help(type(x)) for signature

closeListeningConnections()
initialize(servicesList)
serve()
stopAllProcess()

It stops all the running processes.

stopChildProcesses(_sig, frame)

It is used to properly stop the service when more than one process are used. In principle this is doing the job of runsv, becuase runsv only send a sigterm to the parent process…

Parameters:
  • _sig (int) – the signal sent to the process
  • frame (object) – execution frame which contains the child processes