From 6d6909366b3aeec732c0109fb3922ae265d4bb61 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 20 Apr 2014 12:13:33 +0200 Subject: reaktor.py: set cwd --- IRC/reaktor.py | 4 +++- config.py | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/IRC/reaktor.py b/IRC/reaktor.py index 830e6a9..b820039 100755 --- a/IRC/reaktor.py +++ b/IRC/reaktor.py @@ -60,6 +60,8 @@ class Reaktor(asybot): if match.groupdict().get('args',None): myargv += shlex.split(match.groupdict()['args']) + cwd = getconf('workdir') + env = {} env['_prefix'] = prefix env['_from'] = prefix.split('!', 1)[0] @@ -74,7 +76,7 @@ class Reaktor(asybot): env['config_filename'] = os.path.abspath(config_filename) start = time() try: - p = popen(myargv, bufsize=1, stdout=PIPE, stderr=PIPE, env=env) + p = popen(myargv, bufsize=1, stdout=PIPE, stderr=PIPE, env=env, cwd=cwd) except (OSError, Exception) as error: self.ME(target, 'brain damaged') log.error('OSError@%s: %s' % (myargv, error)) diff --git a/config.py b/config.py index 88ae837..8870137 100644 --- a/config.py +++ b/config.py @@ -1,9 +1,12 @@ +from os import environ debug = True # CAVEAT name should not contains regex magic name = 'crabmanner' +workdir = environ['HOME'] + '/state' + irc_alarm_timeout = 300 irc_hammer_interval = 10 irc_kill_timeout = 360 -- cgit v1.2.3