mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Name the Reqserver processManager
This commit is contained in:
parent
18e3838b89
commit
56357e7d78
@ -490,7 +490,7 @@ class ReqServer(object):
|
||||
os.remove(dfn)
|
||||
except os.error:
|
||||
pass
|
||||
self.process_manager = salt.utils.process.ProcessManager()
|
||||
self.process_manager = salt.utils.process.ProcessManager(name='ReqServer_ProcessManager')
|
||||
|
||||
for ind in range(int(self.opts['worker_threads'])):
|
||||
self.process_manager.add_process(MWorker,
|
||||
|
@ -116,10 +116,14 @@ class ProcessManager(object):
|
||||
'''
|
||||
A class which will manage processes that should be running
|
||||
'''
|
||||
def __init__(self):
|
||||
def __init__(self, name=None):
|
||||
# pid -> {tgt: foo, Process: object, args: args, kwargs: kwargs}
|
||||
self._process_map = {}
|
||||
|
||||
self.name = name
|
||||
if self.name is None:
|
||||
self.name = self.__class__.__name__
|
||||
|
||||
def add_process(self, tgt, args=[], kwargs={}):
|
||||
'''
|
||||
Create a processes and args + kwargs
|
||||
@ -157,13 +161,11 @@ class ProcessManager(object):
|
||||
|
||||
del self._process_map[pid]
|
||||
|
||||
def run(self, name=None):
|
||||
def run(self):
|
||||
'''
|
||||
Load and start all available api modules
|
||||
'''
|
||||
if name is None:
|
||||
name = self.__class__.__name__
|
||||
salt.utils.appendproctitle(name)
|
||||
salt.utils.appendproctitle(self.name)
|
||||
# make sure to kill the subprocesses if the parent is killed
|
||||
signal.signal(signal.SIGTERM, self.kill_children)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user