fix: clean exit on Ctrl+C in muxplex service logs
subprocess.run with check=True raised CalledProcessError then KeyboardInterrupt on Ctrl+C, printing an ugly traceback. Fix: remove check=True, catch KeyboardInterrupt, exit silently.
This commit is contained in:
+8
-2
@@ -152,7 +152,10 @@ def _systemd_status() -> None:
|
||||
|
||||
|
||||
def _systemd_logs() -> None:
|
||||
subprocess.run(["journalctl", "--user", "-u", "muxplex", "-f"], check=True)
|
||||
try:
|
||||
subprocess.run(["journalctl", "--user", "-u", "muxplex", "-f"])
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -205,7 +208,10 @@ def _launchd_status() -> None:
|
||||
|
||||
|
||||
def _launchd_logs() -> None:
|
||||
subprocess.run(["tail", "-f", "/tmp/muxplex.log"], check=True)
|
||||
try:
|
||||
subprocess.run(["tail", "-f", "/tmp/muxplex.log"])
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user