From 76ead86e2c46e735a7083fdf315801e15f3e551b Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 20 Jun 2020 12:57:15 +0200 Subject: [PATCH] commands: Add a helpful error message instead of OSError when a subprocess can't be started. --- src/commands.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/commands.py b/src/commands.py index a7a90c396..95a9b6722 100644 --- a/src/commands.py +++ b/src/commands.py @@ -129,7 +129,17 @@ def process(f, *args, **kwargs): targetArgs = (f, q,) + args p = callbacks.CommandProcess(target=newf, args=targetArgs, kwargs=kwargs) - p.start() + try: + p.start() + except OSError as e: + log.error( + 'Failed to start a subprocess because of the following error: %s ' + 'This might be caused by the way Limnoria is demonized / run in ' + 'the background. Instead, try running it as a service ' + ', ' + 'use the --daemon option, or run it in screen/tmux.', + e) + raise p.join(timeout) if p.is_alive(): p.terminate()