File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed
Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -333,11 +333,41 @@ compute_status(pe_working_set_t * data_set)
333333 }
334334 }
335335
336+ /* If we are in shutdown-state once this will go on till the end.
337+ * If we've on top reached a state of 0 locally running resources
338+ * we can assume a clean shutdown.
339+ * Tricky are the situations where the node is in maintenance-mode
340+ * or resources are unmanaged. So if the node is in maintenance or
341+ * all left-over running resources are unmanaged we assume intention.
342+ */
336343 if (node -> details -> shutdown ) {
337344 pcmk_shutdown = 1 ;
338345 }
339- if (pcmk_shutdown && !(node -> details -> running_rsc )) {
346+ if (pcmk_shutdown )
347+ {
340348 pcmk_clean_shutdown = 1 ;
349+ if (!(node -> details -> maintenance )) {
350+ GListPtr iter ;
351+
352+ for (iter = node -> details -> running_rsc ;
353+ iter != NULL ; iter = iter -> next ) {
354+ resource_t * rsc = (resource_t * ) iter -> data ;
355+
356+
357+ if (is_set (rsc -> flags , pe_rsc_managed )) {
358+ pcmk_clean_shutdown = 0 ;
359+ crm_debug ("not clean as %s managed and still running" ,
360+ rsc -> id );
361+ break ;
362+ }
363+ }
364+ if (pcmk_clean_shutdown ) {
365+ crm_debug ("pcmk_clean_shutdown because "
366+ "all managed resources down" );
367+ }
368+ } else {
369+ crm_debug ("pcmk_clean_shutdown because node is in maintenance" );
370+ }
341371 }
342372 notify_parent ();
343373 return ;
You can’t perform that action at this time.
0 commit comments