diff --git a/base.py b/base.py index 351d914..60a9b64 100644 --- a/base.py +++ b/base.py @@ -230,7 +230,6 @@ class ServiceManager: print_wait = False continue self.stopped[ins][service] = ' '.join(p.info['cmdline']) - done = True break else: if action == 'kill': @@ -238,6 +237,7 @@ class ServiceManager: break continue break + done = True print('%s %s %s' % (ins, service, (action + 'ed').replace('eed', 'ed'))) return done diff --git a/frappyman.py b/frappyman.py index 74a4312..58c81bb 100644 --- a/frappyman.py +++ b/frappyman.py @@ -20,7 +20,9 @@ # # ***************************************************************************** -#import os +import sys +import os +from os.path import join from servicemanager.base import ServiceManager, ServiceDown, UsageError @@ -39,14 +41,26 @@ class FrappyManager(ServiceManager): %s """ + def config_dirs(self, ins, service): + cfgpaths = [] + for cfgpath in self.env[ins].get('SECOP_CONFDIR', '').split(os.pathsep): + cfgpaths.extend([join(cfgpath, service), cfgpath]) + return cfgpaths + def prepare_start(self, ins, service): start_dir, env = super().prepare_start(ins, service) his = env.get('FRAPPY_HISTORY') if his: env['FRAPPY_HISTORY'] = his.replace('_SERVICE', '_' + service) + cfgpaths = self.config_dirs(ins, service) + if cfgpaths: + env['SECOP_CONFDIR'] = os.pathsep.join(cfgpaths) + print(env['SECOP_CONFDIR']) return start_dir, env def do_gui(self, ins='', service='main'): + start_dir, env = self.prepare_start(ins, service) + sys.path.insert(0, start_dir) try: self.check_running(ins, service) except ServiceDown as e: diff --git a/seaman.py b/seaman.py index 2606f3a..3d24ff0 100644 --- a/seaman.py +++ b/seaman.py @@ -51,8 +51,8 @@ class SeaManager(ServiceManager): Usage: sea gui - sea # the same as sea gui - sea cli # the same as old seacmd + sea # the same as sea gui + sea cli # the same as old seacmd sea start [] sea restart [] sea stop []