Fix signal requested reload of parameters. Closes #1853

This commit is contained in:
Mr-Dave
2025-03-13 12:25:27 -06:00
parent 8ba92685ba
commit 1a7a09be3c

View File

@@ -125,22 +125,10 @@ void cls_motapp::signal_process()
}
break;
case MOTION_SIGNAL_SIGHUP: /* Reload the parameters and restart*/
MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO
,_("Reloading parameters"));
reload_all = true;
webu->finish = true;
for (indx=0; indx<cam_cnt; indx++) {
cam_list[indx]->event_stop = true;
cam_list[indx]->handler_stop = true;
}
for (indx=0; indx<snd_cnt; indx++) {
snd_list[indx]->handler_stop = true;
}
for (indx=0; indx<cam_cnt; indx++) {
cam_list[indx]->handler_shutdown();
}
for (indx=0; indx<snd_cnt; indx++) {
snd_list[indx]->handler_shutdown();
}
break;
/*FALLTHROUGH*/
case MOTION_SIGNAL_SIGTERM: /* Quit application */
webu->finish = true;
webu->restart = false;
@@ -516,6 +504,9 @@ void cls_motapp::init(int p_argc, char *p_argv[])
webu = nullptr;
allcam = nullptr;
schedule = nullptr;
cam_list.clear();
snd_list.clear();
pthread_mutex_init(&mutex_camlst, NULL);
pthread_mutex_init(&mutex_post, NULL);