forked from Github/frigate
Refactor s6 scripts to the new format (#5135)
* Refator s6 scripts to the new format * Remove unneeded workaround * Migrate logging to new s6 format * Remove more unnecessary s6 variables * Fix prepare-log and when go2rtc is not present in config * Restart the whole container if either Frigate or go2rtc fails * D * Fix service name in finish * Fix nginx finish comment * Restart improvements * Fix devcontainer * Fix format * Update Dockerfile Co-authored-by: Felipe Santos <felipecassiors@gmail.com> Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
This commit is contained in:
@@ -769,7 +769,10 @@ def config_save():
|
||||
logging.error(f"Error restarting Frigate: {e}")
|
||||
return "Config successfully saved, unable to restart Frigate", 200
|
||||
|
||||
return "Config successfully saved, restarting...", 200
|
||||
return (
|
||||
"Config successfully saved, restarting (this can take up to one minute)...",
|
||||
200,
|
||||
)
|
||||
else:
|
||||
return "Config successfully saved.", 200
|
||||
|
||||
|
||||
@@ -628,13 +628,8 @@ def clipped(obj, frame_shape):
|
||||
|
||||
|
||||
def restart_frigate():
|
||||
proc = psutil.Process(1)
|
||||
# if this is running via s6, sigterm pid 1
|
||||
if proc.name() == "s6-svscan":
|
||||
proc.terminate()
|
||||
# otherwise, just try and exit frigate
|
||||
else:
|
||||
os.kill(os.getpid(), signal.SIGTERM)
|
||||
# S6 overlay is configured to exit once the Frigate process exits
|
||||
os.kill(os.getpid(), signal.SIGTERM)
|
||||
|
||||
|
||||
class EventsPerSecond:
|
||||
|
||||
Reference in New Issue
Block a user