Add sending SIGHUP signal to Nginx master process in app.py

This commit is contained in:
Sergey Krashevich 2023-06-20 00:22:23 +03:00
parent 67bf3a4a7b
commit 5049c91475
No known key found for this signature in database
GPG Key ID: 625171324E7D3856

View File

@ -225,6 +225,13 @@ class FrigateApp:
) )
f.write(line) f.write(line)
# get the nginx master process id
with open("/var/run/nginx.pid", "r") as pid_file:
pid = int(pid_file.read().strip())
# sending SIGHUP signal to nginx master process
os.kill(pid, signal.SIGHUP)
def init_go2rtc(self) -> None: def init_go2rtc(self) -> None:
for proc in psutil.process_iter(["pid", "name"]): for proc in psutil.process_iter(["pid", "name"]):
if proc.info["name"] == "go2rtc": if proc.info["name"] == "go2rtc":