- int ActiveBackgroundJobs;
- int do_housekeeping_now = 0;
- struct CitContext *nptr;
- int nContexts, i;
-
-retry_block_housekeeping:
- syslog(LOG_INFO, "housekeeping: trying to disable services");
- begin_critical_section(S_HOUSEKEEPING);
- if (housekeeping_in_progress == 0) {
- do_housekeeping_now = 1;
- housekeeping_in_progress = 1;
- }
- end_critical_section(S_HOUSEKEEPING);
- if (do_housekeeping_now == 0) {
- usleep(1000000);
- goto retry_block_housekeeping;
- }
-
- syslog(LOG_INFO, "housekeeping: checking for running server jobs");
+ syslog(LOG_INFO, "housekeeping: trying to disable");
+ while ( (!housekeeping_disabled) && (!server_shutting_down) && (!housekeeping_in_progress) ) {