From d921d0d6c44db900e86c4cb50f97c1428dd24edb Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Sat, 30 Jun 2018 06:05:10 +0300 Subject: fixed cleanup --- kvmd/kvmd/extras/cleanup/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kvmd/kvmd/extras/cleanup/__init__.py b/kvmd/kvmd/extras/cleanup/__init__.py index 040accdf..4e438e0f 100644 --- a/kvmd/kvmd/extras/cleanup/__init__.py +++ b/kvmd/kvmd/extras/cleanup/__init__.py @@ -1,3 +1,4 @@ +import os import subprocess import time @@ -20,13 +21,14 @@ def main() -> None: ]: if pin > 0: logger.info("Writing value=0 to pin=%d (%s)", pin, key) - gpio.write(pin, False) + gpio.set_output(pin, initial=False) - logger.info("Trying to find and kill mjpg_streamer ...") + streamer = os.path.basename(config["video"]["cmd"][0]) + logger.info("Trying to find and kill %r ...", streamer) try: - subprocess.check_output(["killall", "mjpg_streamer"], stderr=subprocess.STDOUT) + subprocess.check_output(["killall", streamer], stderr=subprocess.STDOUT) time.sleep(3) - subprocess.check_output(["killall", "-9", "mjpg_streamer"], stderr=subprocess.STDOUT) + subprocess.check_output(["killall", "-9", streamer], stderr=subprocess.STDOUT) except subprocess.CalledProcessError: pass -- cgit v1.2.3