diff --git a/cfg/linse-dil5.cfg b/cfg/linse-dil5.cfg index 72cbd25..45271c7 100644 --- a/cfg/linse-dil5.cfg +++ b/cfg/linse-dil5.cfg @@ -16,5 +16,6 @@ port=5000 cfg=dil5 [BOXWEB] -port=80 +port=8050 +wsport=8010 page=dil5 diff --git a/install.py b/install.py index 80ec290..b10fbc4 100755 --- a/install.py +++ b/install.py @@ -157,24 +157,13 @@ ExecStart = /usr/bin/python3 {TOOLS}/display.py -d WantedBy = multi-user.target """ -DISPLAY_SERVICE = f"""[Unit] -Description = status display -After = network.target - -[Service] -User = root -ExecStart = /usr/bin/python3 {TOOLS}/display.py -d - -[Install] -WantedBy = multi-user.target -""" - BOXWEB_SERVICE = """[Unit] Description = Web service for local GUI on a box After = waitboot.target [Service] -ExecStart = /usr/bin/python /home/l_samenv/boxweb/flaskserver.py {page} {port} +WorkingDirectory = /home/l_samenv/boxweb +ExecStart = /usr/bin/python flaskserver.py {page}.{port}.{wsport} [Install] WantedBy = default.target @@ -267,15 +256,17 @@ def pip(): show.dirty = True -def boxweb(port=8080, page=None): +def boxweb(port=8080, wsport=8051, page=None): if page is None: servicecfg = None else: port = int(port) main_ports.add(port) + wsport = int(wsport) + main_ports.add(wsport) if port == 8080: main_ports.add(80) - servicecfg = BOXWEB_SERVICE.format(port=port, page=page) + servicecfg = BOXWEB_SERVICE.format(port=port, wsport=wsport, page=page) for file, dest in (('labwc.service', '/etc/systemd/system'), ('boxweb-browser.service', '/home/l_samenv/.config/systemd/user')): src = TOOLS / 'desktop' / file diff --git a/to_home/.config/linse.bash b/to_home/.config/linse.bash index c6e6cdb..a176841 100644 --- a/to_home/.config/linse.bash +++ b/to_home/.config/linse.bash @@ -25,7 +25,7 @@ boxweb() { if [[ -z "$1" ]]; then echo "Usage: boxweb status|start|stop|restart" else - sudo systemctl $1 boxweb + systemctl --user $1 boxweb fi }