Commit b74159ee authored by Iustin Pop's avatar Iustin Pop
Browse files

Disable forking in the master daemon

This patch adds a mechanism to disable utils.RunCmd in selected
programs. This is needed in the master daemon unless we confirm
threading doesn't pose any problems.

This makes cluster init fail, but creating new trunk clusters is anyway
broken at the moment.

Reviewed-by: ultrotter
parent b6023d6c
......@@ -332,6 +332,7 @@ def main():
options, args = ParseOptions()
utils.debug = options.debug
utils.no_fork = True
......@@ -51,6 +51,7 @@ _locksheld = []
_re_shell_unquoted = re.compile('^[-.,=:/_+@A-Za-z0-9]+$')
debug = False
no_fork = False
class RunResult(object):
......@@ -219,6 +220,9 @@ def RunCmd(cmd):
Returns: `RunResult` instance
if no_fork:
raise errors.ProgrammerError("utils.RunCmd() called with fork() disabled")
if isinstance(cmd, list):
cmd = [str(val) for val in cmd]
strcmd = " ".join(cmd)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment