diff options
Diffstat (limited to 'init.c')
-rw-r--r-- | init.c | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -336,9 +336,9 @@ static pid_t run(const char * const* command, | |||
336 | } | 336 | } |
337 | 337 | ||
338 | /* Log the process name and args */ | 338 | /* Log the process name and args */ |
339 | message(LOG, "Starting pid %d, console %s: '", getpid(), terminal); | 339 | message(LOG|CONSOLE, "Starting pid %d, console %s: '", getpid(), terminal); |
340 | while ( *cmd) message(LOG, "%s ", *cmd++); | 340 | while ( *cmd) message(LOG|CONSOLE, "%s ", *cmd++); |
341 | message(LOG, "'\r\n"); | 341 | message(LOG|CONSOLE, "'\r\n"); |
342 | 342 | ||
343 | /* Now run it. The new program will take over this PID, | 343 | /* Now run it. The new program will take over this PID, |
344 | * so nothing further in init.c should be run. */ | 344 | * so nothing further in init.c should be run. */ |
@@ -418,8 +418,10 @@ static void halt_signal(int sig) | |||
418 | "The system is halted. Press CTRL-ALT-DEL or turn off power\r\n"); | 418 | "The system is halted. Press CTRL-ALT-DEL or turn off power\r\n"); |
419 | sync(); | 419 | sync(); |
420 | #ifndef DEBUG_INIT | 420 | #ifndef DEBUG_INIT |
421 | reboot(RB_HALT_SYSTEM); | 421 | if (sig == SIGUSR2) |
422 | //reboot(RB_POWER_OFF); | 422 | reboot(RB_POWER_OFF); |
423 | else | ||
424 | reboot(RB_HALT_SYSTEM); | ||
423 | #endif | 425 | #endif |
424 | exit(0); | 426 | exit(0); |
425 | } | 427 | } |
@@ -514,8 +516,11 @@ extern int init_main(int argc, char **argv) | |||
514 | } else | 516 | } else |
515 | message(CONSOLE|LOG, "Mounting /proc: failed!\n"); | 517 | message(CONSOLE|LOG, "Mounting /proc: failed!\n"); |
516 | 518 | ||
519 | fprintf(stderr, "got proc\n"); | ||
520 | |||
517 | /* Make sure there is enough memory to do something useful. */ | 521 | /* Make sure there is enough memory to do something useful. */ |
518 | check_memory(); | 522 | check_memory(); |
523 | fprintf(stderr, "got check_memory\n"); | ||
519 | 524 | ||
520 | /* Check if we are supposed to be in single user mode */ | 525 | /* Check if we are supposed to be in single user mode */ |
521 | if ( argc > 1 && (!strcmp(argv[1], "single") || | 526 | if ( argc > 1 && (!strcmp(argv[1], "single") || |
@@ -524,6 +529,7 @@ extern int init_main(int argc, char **argv) | |||
524 | tty1_command = shell_command; | 529 | tty1_command = shell_command; |
525 | tty2_command = shell_command; | 530 | tty2_command = shell_command; |
526 | } | 531 | } |
532 | fprintf(stderr, "got single\n"); | ||
527 | 533 | ||
528 | /* Make sure an init script exists before trying to run it */ | 534 | /* Make sure an init script exists before trying to run it */ |
529 | if (single==FALSE && stat(INITSCRIPT, &statbuf)==0) { | 535 | if (single==FALSE && stat(INITSCRIPT, &statbuf)==0) { |
@@ -535,6 +541,7 @@ extern int init_main(int argc, char **argv) | |||
535 | /* Make sure /sbin/getty exists before trying to run it */ | 541 | /* Make sure /sbin/getty exists before trying to run it */ |
536 | if (stat(GETTY, &statbuf)==0) { | 542 | if (stat(GETTY, &statbuf)==0) { |
537 | char* where; | 543 | char* where; |
544 | fprintf(stderr, "\n"); | ||
538 | wait_for_enter_tty2 = FALSE; | 545 | wait_for_enter_tty2 = FALSE; |
539 | where = strrchr( console, '/'); | 546 | where = strrchr( console, '/'); |
540 | if ( where != NULL) { | 547 | if ( where != NULL) { |