mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 09:10:30 +08:00
try to find and kill mjpg_streamer
This commit is contained in:
parent
d9c0e62cec
commit
65bee96fef
@ -1,4 +1,6 @@
|
|||||||
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
|
import time
|
||||||
|
|
||||||
from ...application import init
|
from ...application import init
|
||||||
|
|
||||||
@ -19,4 +21,13 @@ def main() -> None:
|
|||||||
]:
|
]:
|
||||||
_logger.info("Writing value=0 to pin=%d (%s)", pin, key)
|
_logger.info("Writing value=0 to pin=%d (%s)", pin, key)
|
||||||
gpio.write(pin, False)
|
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")
|
_logger.info("Bye-bye")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user