summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-06-28 08:04:22 +0300
committerDevaev Maxim <[email protected]>2018-06-28 08:04:22 +0300
commit65bee96fefbcce8d0730f112f0a1e73fab099a35 (patch)
tree94e78fc168bb33ce93b8da66fdb40ed6c1b93190
parentd9c0e62cec7e762c9a92a8a09fa9930d2ff5ac28 (diff)
try to find and kill mjpg_streamer
-rw-r--r--kvmd/kvmd/extras/cleanup/__init__.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/kvmd/kvmd/extras/cleanup/__init__.py b/kvmd/kvmd/extras/cleanup/__init__.py
index b7329e90..62c1a709 100644
--- a/kvmd/kvmd/extras/cleanup/__init__.py
+++ b/kvmd/kvmd/extras/cleanup/__init__.py
@@ -1,4 +1,6 @@
+import subprocess
import logging
+import time
from ...application import init
@@ -19,4 +21,13 @@ def main() -> None:
]:
_logger.info("Writing value=0 to pin=%d (%s)", pin, key)
gpio.write(pin, False)
+
+ _logger.info("Trying to find and kill mjpg_streamer ...")
+ try:
+ subprocess.check_output(["killall", "mjpg_streamer"], stderr=subprocess.STDOUT)
+ time.sleep(3)
+ subprocess.check_output(["killall", "-9", "mjpg_streamer"], stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError:
+ pass
+
_logger.info("Bye-bye")