"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/monit.c" between
monit-5.27.2.tar.gz and monit-5.28.0.tar.gz

About: Monit is a utility for managing and monitoring processes, files, directories and filesystems (with automatic error recovery).

monit.c  (monit-5.27.2):monit.c  (monit-5.28.0)
skipping to change at line 392 skipping to change at line 392
/* send the monit startup notification */ /* send the monit startup notification */
Event_post(Run.system, Event_Instance, State_Changed, Run.system->action _MONIT_START, "Monit reloaded"); Event_post(Run.system, Event_Instance, State_Changed, Run.system->action _MONIT_START, "Monit reloaded");
if (Run.mmonits) { if (Run.mmonits) {
Thread_create(heartbeatThread, heartbeat, NULL); Thread_create(heartbeatThread, heartbeat, NULL);
heartbeatRunning = true; heartbeatRunning = true;
} }
} }
static bool _isMemberOfGroup(Service_T s, ServiceGroup_T g) {
for (list_t m = g->members->head; m; m = m->next) {
Service_T member = m->e;
if (s == member)
return true;
}
return false;
}
static bool _hasParentInTheSameGroup(Service_T s, ServiceGroup_T g) {
for (Dependant_T d = s->dependantlist; d; d = d->next ) {
Service_T parent = Util_getService(d->dependant);
if (parent && _isMemberOfGroup(parent, g))
return true;
}
return false;
}
/** /**
* Dispatch to the submitted action - actions are program arguments * Dispatch to the submitted action - actions are program arguments
*/ */
static void do_action(List_T arguments) { static void do_action(List_T arguments) {
char *action = List_pop(arguments); char *action = List_pop(arguments);
Run.flags |= Run_Once; Run.flags |= Run_Once;
if (! action) { if (! action) {
do_default(); do_default();
skipping to change at line 416 skipping to change at line 434
IS(action, "restart")) { IS(action, "restart")) {
char *service = List_pop(arguments); char *service = List_pop(arguments);
if (Run.mygroup || service) { if (Run.mygroup || service) {
int errors = 0; int errors = 0;
List_T services = List_new(); List_T services = List_new();
if (Run.mygroup) { if (Run.mygroup) {
for (ServiceGroup_T sg = servicegrouplist; sg; s g = sg->next) { for (ServiceGroup_T sg = servicegrouplist; sg; s g = sg->next) {
if (IS(Run.mygroup, sg->name)) { if (IS(Run.mygroup, sg->name)) {
for (list_t m = sg->members->hea d; m; m = m->next) { for (list_t m = sg->members->hea d; m; m = m->next) {
Service_T s = m->e; Service_T s = m->e;
if (IS(action, "restart"
) && _hasParentInTheSameGroup(s, sg)) {
DEBUG("Restart o
f %s skipped -- it'll be handled as part of the dependency chain, as the parent
service is member of the same group\n", s->name);
continue;
}
List_append(services, s- >name); List_append(services, s- >name);
} }
break; break;
} }
} }
if (List_length(services) == 0) { if (List_length(services) == 0) {
List_free(&services); List_free(&services);
Log_error("Group '%s' not found\n", Run. mygroup); Log_error("Group '%s' not found\n", Run. mygroup);
exit(1); exit(1);
} }
skipping to change at line 866 skipping to change at line 888
#endif #endif
printf(" compression, with"); printf(" compression, with");
#ifndef HAVE_LIBPAM #ifndef HAVE_LIBPAM
printf("out"); printf("out");
#endif #endif
printf(" pam and with"); printf(" pam and with");
#ifndef HAVE_LARGEFILES #ifndef HAVE_LARGEFILES
printf("out"); printf("out");
#endif #endif
printf(" large files\n"); printf(" large files\n");
printf("Copyright (C) 2001-2020 Tildeslash Ltd. All Rights Reserved.\n") ; printf("Copyright (C) 2001-2021 Tildeslash Ltd. All Rights Reserved.\n") ;
} }
/** /**
* M/Monit heartbeat thread * M/Monit heartbeat thread
*/ */
static void *heartbeat(__attribute__ ((unused)) void *args) { static void *heartbeat(__attribute__ ((unused)) void *args) {
set_signal_block(); set_signal_block();
Log_info("M/Monit heartbeat started\n"); Log_info("M/Monit heartbeat started\n");
LOCK(heartbeatMutex) LOCK(heartbeatMutex)
{ {
 End of changes. 3 change blocks. 
1 lines changed or deleted 26 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)