~ubuntu-branches/ubuntu/trusty/monit/trusty

« back to all changes in this revision

Viewing changes to .pc/11_enable_hurd.patch/src/validate.c

  • Committer: Package Import Robot
  • Author(s): Sergey B Kirpichev
  • Date: 2013-09-05 17:03:07 UTC
  • mfrom: (1.1.19)
  • Revision ID: package-import@ubuntu.com-20130905170307-ae94md1vagm60e41
Tags: 1:5.6-1
ImportedĀ UpstreamĀ versionĀ 5.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
195
195
        } else
196
196
                Event_post(s, Event_Nonexist, STATE_SUCCEEDED, s->action_NONEXIST, "process is running with pid %d", (int)pid);
197
197
 
 
198
        /* Reset the exec and timeout errors if active ... the process is running (most probably after manual intervention) */
198
199
        if (IS_EVENT_SET(s->error, Event_Exec))
199
200
                Event_post(s, Event_Exec, STATE_SUCCEEDED, s->action_EXEC, "process is running after previous exec error (slow starting or manually recovered?)");
 
201
        if (IS_EVENT_SET(s->error, Event_Timeout))
 
202
                for (ActionRate_T ar = s->actionratelist; ar; ar = ar->next)
 
203
                        Event_post(s, Event_Timeout, STATE_SUCCEEDED, ar->action, "process is running after previous restart timeout (manually recovered?)");
200
204
 
201
205
        if (Run.doprocess) {
202
206
                if (update_process_data(s, ptree, ptreesize, pid)) {
895
899
 
896
900
                Event_post(s, Event_Data, STATE_SUCCEEDED, s->action_DATA, "checksum computed for %s", s->path);
897
901
 
 
902
                if (! cs->initialized) {
 
903
                        cs->initialized = TRUE;
 
904
                        snprintf(cs->hash, sizeof(cs->hash), "%s", s->inf->priv.file.cs_sum);
 
905
                }
 
906
 
898
907
                switch(cs->type) {
899
908
                        case HASH_MD5:
900
909
                                changed = strncmp(cs->hash, s->inf->priv.file.cs_sum, 32);
910
919
 
911
920
                if (changed) {
912
921
 
913
 
                        /* if we are testing for changes only, the value is variable */
914
922
                        if (cs->test_changes) {
915
 
                                if (!cs->test_changes_ok)
916
 
                                /* the checksum was not initialized during monit start, so set the checksum now and allow further checksum change testing */
917
 
                                        cs->test_changes_ok = TRUE;
918
 
                                else
919
 
                                        Event_post(s, Event_Checksum, STATE_CHANGED, cs->action, "checksum was changed for %s", s->path);
920
 
 
 
923
                                /* if we are testing for changes only, the value is variable */
 
924
                                Event_post(s, Event_Checksum, STATE_CHANGED, cs->action, "checksum was changed for %s", s->path);
921
925
                                /* reset expected value for next cycle */
922
926
                                snprintf(cs->hash, sizeof(cs->hash), "%s", s->inf->priv.file.cs_sum);
923
 
 
924
 
                        } else
925
 
                        /* we are testing constant value for failed or succeeded state */
 
927
                        } else {
 
928
                                /* we are testing constant value for failed or succeeded state */
926
929
                                Event_post(s, Event_Checksum, STATE_FAILED, cs->action, "checksum test failed for %s", s->path);
 
930
                        }
927
931
 
928
932
                } else if (cs->test_changes) {
929
933
 
1045
1049
 
1046
1050
                /* if we are testing for changes only, the value is variable */
1047
1051
                if (sl->test_changes) {
1048
 
                        if (!sl->test_changes_ok) {
 
1052
                        if (!sl->initialized) {
1049
1053
                                /* the size was not initialized during monit start, so set the size now
1050
1054
                                 * and allow further size change testing */
1051
 
                                sl->test_changes_ok = TRUE;
 
1055
                                sl->initialized = TRUE;
1052
1056
                                sl->size = s->inf->priv.file.st_size;
1053
1057
                        } else {
1054
1058
                                if (sl->size != s->inf->priv.file.st_size) {