-
- /*
- * Don't modify **argv directly, it would show up in the "ps" display.
- * I don't want "init" to look like "rc".
- */
- arguments[0] = rc;
- for ( j = 1; j < argc; j++ ) {
- arguments[j] = argv[j];
- }
- arguments[j] = 0;
-
- if ( run_rc ) {
- printf("running %s with args \"",rc);
- for ( j = 0; j < argc; j++ ) {
- printf("%s ", arguments[j]);
- }
- printf("\" on console %s\n", console);
- waitfor(run(rc, arguments, console, 0));
- printf("done.\n");
- }
-
- if ( 0 == create_swap) {
- if (unlink("/etc/swappartition")) {
- perror("unlinking /etc/swappartition");
- }
- }
-
- arguments[0] = "-sh";
- arguments[1] = 0;
- for ( ; ; ) {
- int wpid;
- int status;
-
- if ( pid1 == 0 && tty_commands[0] ) {
- /* Ask before starting a shell */
- /*
- arguments[0] = tty_commands[0];
- */
- printf("running %s with args \"",tty_commands[0]);
- for ( j = 0; j < argc; j++ ) {
- printf("%s ", arguments[j]);
- }
- printf("\" on console %s\n", first_terminal);
- pid1 = run(tty_commands[0], arguments, first_terminal, 1);
- }
- if ( pid2 == 0 && tty_commands[1] ) {
- printf("running %s with args \"",tty_commands[0]);
- for ( j = 0; j < argc; j++ ) {
- printf("%s ", arguments[j]);
- }
- printf("\" on console %s\n", first_terminal);
- pid2 = run(tty_commands[1], arguments, second_terminal, 1);
- }
- wpid = wait(&status);
- if ( wpid > 0 ) {
- /* DEBUGGING */
- message(log, "pid %d exited, status=%x.\n", wpid, status);
- }
- if ( wpid == pid1 ) {
- pid1 = 0;
- }
- if ( wpid == pid2 )
- pid2 = 0;