let start_frappy be the only process

This commit is contained in:
2025-06-27 14:00:01 +02:00
parent a9ff9d66a5
commit 871c65ff9e

View File

@ -1,20 +1,23 @@
#!/usr/bin/env python #!/usr/bin/env python
import sys import sys
import os sys.path.append('/home/l_samenv/frappy')
import time import time
from frappy.lib import generalConfig
from frappy.logging import logger
from frappy.server import Server
from utils import BoxInfo from utils import BoxInfo
box = BoxInfo() box = BoxInfo()
def start_frappy(cfg, port=None): def main(cfg, port=None, **_):
cmd = ['/home/l_samenv/frappy/bin/frappy-server'] generalConfig.init()
if port: logger.init('info')
cmd.append('-p') srv = Server(cfg, logger.log, cfgfiles=None, interface=port)
cmd.append(str(port)) srv.run()
cmd.append(cfg)
os.system(' '.join(cmd))
if len(sys.argv) > 1: if len(sys.argv) > 1:
time.sleep(int(sys.argv[1])) time.sleep(int(sys.argv[1]))
start_frappy(**box.read_config('FRAPPY')) main(**box.read_config('FRAPPY'))