Changeset 23039
- Timestamp:
- 02/07/07 13:07:49 (22 months ago)
- Files:
-
- 1 modified
-
trunk/launchd/src/launchd.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/launchd/src/launchd.c
r23025 r23039 301 301 */ 302 302 if (!h && stat(ldconf, &sb) == 0) { 303 job_dispatch(rlcj, true);303 rlcj = job_dispatch(rlcj, true); 304 304 } 305 305 306 306 if (fbj) { 307 job_dispatch(fbj, true);307 fbj = job_dispatch(fbj, true); 308 308 } 309 309 … … 475 475 launchd_single_user(void) 476 476 { 477 int tries; 477 syslog(LOG_NOTICE, "Going to single-user mode"); 478 479 re_exec_in_single_user_mode = true; 478 480 479 481 launchd_shutdown(); 480 482 481 kill(-1, SIGTERM); 482 483 for (tries = 0; tries < 10; tries++) { 484 sleep(1); 485 if (kill(-1, 0) == -1 && errno == ESRCH) { 486 goto out; 487 } 488 } 489 490 syslog(LOG_WARNING, "Gave up waiting for processes to exit while going to single user mode, sending SIGKILL"); 483 sleep(3); 484 491 485 kill(-1, SIGKILL); 492 493 out:494 re_exec_in_single_user_mode = true;495 486 } 496 487 … … 502 493 case SIGHUP: 503 494 if (rlcj) { 504 job_dispatch(rlcj, true);495 rlcj = job_dispatch(rlcj, true); 505 496 } 506 497 break; … … 692 683 } else if (re_exec_in_single_user_mode) { 693 684 re_exec_in_single_user_mode = false; 685 kill(-1, SIGKILL); /* One last time, just to clear the room */ 694 686 launchd_assumes(execl("/sbin/launchd", "/sbin/launchd", "-s", NULL) != -1); 695 687 }

