redirect all fd of slapd instances to /dev/null
This commit is contained in:
parent
4adfa74fac
commit
19922faaf8
|
@ -90,9 +90,14 @@ olcAccess: {{0}}to *
|
|||
checkpoints = None
|
||||
data_dirs = None
|
||||
|
||||
def create_process(self, args):
|
||||
return subprocess.Popen(args, stdin=subprocess.PIPE, env=os.environ, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
def create_process(self, args, pipe=True):
|
||||
if pipe:
|
||||
return subprocess.Popen(args, stdin=subprocess.PIPE, env=os.environ,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
else:
|
||||
DEVNULL = open(os.devnull, 'w')
|
||||
return subprocess.Popen(args, stdin=DEVNULL, env=os.environ, stdout=DEVNULL,
|
||||
stderr=DEVNULL)
|
||||
|
||||
def __init__(self, ldap_url=None):
|
||||
assert has_slapd()
|
||||
|
@ -148,7 +153,7 @@ olcAccess: {{0}}to * by manage'''
|
|||
'-d768', # put slapd in foreground
|
||||
'-F' + self.config_dir,
|
||||
'-h', self.ldap_url]
|
||||
self.process = self.create_process(cmd)
|
||||
self.process = self.create_process(cmd, pipe=False)
|
||||
atexit.register(self.clean)
|
||||
|
||||
while True:
|
||||
|
|
Loading…
Reference in New Issue