let start_frappy be the only process
This commit is contained in:
21
start_frappy
21
start_frappy
@ -1,20 +1,23 @@
|
||||
#!/usr/bin/env python
|
||||
import sys
|
||||
import os
|
||||
sys.path.append('/home/l_samenv/frappy')
|
||||
import time
|
||||
from frappy.lib import generalConfig
|
||||
from frappy.logging import logger
|
||||
from frappy.server import Server
|
||||
from utils import BoxInfo
|
||||
|
||||
box = BoxInfo()
|
||||
|
||||
def start_frappy(cfg, port=None):
|
||||
cmd = ['/home/l_samenv/frappy/bin/frappy-server']
|
||||
if port:
|
||||
cmd.append('-p')
|
||||
cmd.append(str(port))
|
||||
cmd.append(cfg)
|
||||
os.system(' '.join(cmd))
|
||||
def main(cfg, port=None, **_):
|
||||
generalConfig.init()
|
||||
logger.init('info')
|
||||
srv = Server(cfg, logger.log, cfgfiles=None, interface=port)
|
||||
srv.run()
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
time.sleep(int(sys.argv[1]))
|
||||
|
||||
start_frappy(**box.read_config('FRAPPY'))
|
||||
main(**box.read_config('FRAPPY'))
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user