diff -ur sysvinit-org/debian/etc/init.d/rc sysvinit/debian/etc/init.d/rc --- sysvinit-org/debian/etc/init.d/rc Sun Nov 7 16:35:31 1999 +++ sysvinit/debian/etc/init.d/rc Sun Jul 2 12:33:25 2000 @@ -36,6 +36,7 @@ trap ":" INT QUIT TSTP # Set onlcr to avoid staircase effect. + case $1 in 0|5|6) exec <>/dev/tty1 >&0 2>&1; chvt 1 &;; esac stty onlcr 0>&1 # Now find out what the current and what the previous runlevel are. @@ -68,6 +69,7 @@ startup $i stop done fi + sleep 1 # Now run the START scripts for this runlevel. for i in /etc/rc$runlevel.d/S* do @@ -90,7 +92,7 @@ [ -f $previous_start ] && [ ! -f $stop ] && continue fi case "$runlevel" in - 0|6) + 0|5|6) startup $i stop ;; *) diff -ur sysvinit-org/src/halt.c sysvinit/src/halt.c --- sysvinit-org/src/halt.c Mon Mar 9 21:08:38 1998 +++ sysvinit/src/halt.c Sun Jul 2 12:32:02 2000 @@ -3,17 +3,18 @@ * It re-enables CTRL-ALT-DEL, so that a hard reboot can * be done. If called as reboot, it will reboot the system. * - * If the system is not in runlevel 0 or 6, halt will just + * If the system is not in runlevel 0, 5 or 6, halt will just * execute a "shutdown -h" to halt the system, and reboot will * execute an "shutdown -r". This is for compatibility with * sysvinit 2.4. * - * Usage: halt [-n] [-w] [-d] [-f] [-p] + * Usage: halt [-n] [-w] [-d] [-f] [-p] [-l] * -n: don't sync before halting the system * -w: only write a wtmp reboot record and exit. * -d: don't write a wtmp record. * -f: force halt/reboot, don't call shutdown. * -p: power down the system (if possible, otherwise halt) + * -l: force a long reboot (without qreboot) * * Reboot and halt are both this program. Reboot * is just a link to halt. Invoking the program @@ -61,7 +62,7 @@ */ void usage() { - fprintf(stderr, "usage: %s [-n] [-w] [-d] [-f] [-i] [-p]\n", progname); + fprintf(stderr, "usage: %s [-n] [-w] [-d] [-f] [-i] [-p] [-l]\n", progname); exit(1); } @@ -153,6 +154,7 @@ int main(int argc, char **argv) { int do_reboot = 0; + int do_lreboot = 0; int do_sync = 1; int do_wtmp = 1; int do_nothing = 0; @@ -176,12 +178,13 @@ } if (!strcmp(progname, "reboot")) do_reboot = 1; + if (!strcmp(progname, "lreboot")) do_reboot = do_lreboot = 1; if (!strcmp(progname, "poweroff")) do_poweroff = 1; /* * Get flags */ - while((c = getopt(argc, argv, ":idfnpwt:")) != EOF) { + while((c = getopt(argc, argv, ":idfnplwt:")) != EOF) { switch(c) { case 'n': do_sync = 0; @@ -202,6 +205,9 @@ case 'p': do_poweroff = 1; break; + case 'l': + do_lreboot = 1; + break; case 't': tm = optarg; break; @@ -218,8 +224,8 @@ * See if we are in runlevel 0 or 6. */ c = get_runlevel(); - if (c != '0' && c != '6') - do_shutdown(do_reboot ? "-r" : "-h", tm); + if (c != '0' && c != '5' && c != '6') + do_shutdown(do_reboot ? do_lreboot ? "-l" : "-r" : "-h", tm); } /* @@ -242,7 +248,7 @@ (void)ifdown(); if (do_reboot) { - init_reboot(BMAGIC_REBOOT); + init_reboot(do_lreboot ? BMAGIC_LREBOOT : BMAGIC_REBOOT); } else { /* * Turn on hard reboot, CTRL-ALT-DEL will reboot now diff -ur sysvinit-org/src/reboot.h sysvinit/src/reboot.h --- sysvinit-org/src/reboot.h Wed Sep 24 10:55:52 1997 +++ sysvinit/src/reboot.h Sun Jul 2 12:32:02 2000 @@ -13,6 +13,7 @@ #define BMAGIC_HARD 0x89ABCDEF #define BMAGIC_SOFT 0 #define BMAGIC_REBOOT 0x01234567 +#define BMAGIC_LREBOOT 0x07654321 #define BMAGIC_HALT 0xCDEF0123 #define BMAGIC_POWEROFF 0x4321FEDC diff -ur sysvinit-org/src/shutdown.c sysvinit/src/shutdown.c --- sysvinit-org/src/shutdown.c Sat Nov 13 17:39:01 1999 +++ sysvinit/src/shutdown.c Sun Jul 2 12:32:02 2000 @@ -1,9 +1,10 @@ /* * shutdown.c Shut the system down. * - * Usage: shutdown [-krhfnc] time [warning message] + * Usage: shutdown [-krlhfnc] time [warning message] * -k: don't really shutdown, only warn. * -r: reboot after shutdown. + * -l: reboot after shutdown (no qreboot). * -h: halt after shutdown. * -f: do a 'fast' reboot (skip fsck). * -F: Force fsck on reboot. @@ -90,10 +91,11 @@ void usage() { fprintf(stderr, - "Usage:\t shutdown [-akrhfnc] [-t secs] time [warning message]\n" + "Usage:\t shutdown [-akrlhfnc] [-t secs] time [warning message]\n" "\t\t -a: use /etc/shutdown.allow\n" "\t\t -k: don't really shutdown, only warn.\n" "\t\t -r: reboot after shutdown.\n" + "\t\t -l: reboot after shutdown (no qreboot).\n" "\t\t -h: halt after shutdown.\n" "\t\t -f: do a 'fast' reboot (skip fsck).\n" "\t\t -F: Force fsck on reboot.\n" @@ -230,7 +232,7 @@ } /* - * Go to runlevel 0, 1 or 6. + * Go to runlevel 0, 1, 5 or 6. */ void shutdown() { @@ -309,7 +311,7 @@ strcpy(down_level, "1"); /* Process the options. */ - while((c = getopt(argc, argv, "acqkrhnfFyt:g:i:")) != EOF) { + while((c = getopt(argc, argv, "acqkrlhnfFyt:g:i:")) != EOF) { switch(c) { case 'a': /* Access control. */ useacl = 1; @@ -323,6 +325,9 @@ case 'r': /* Automatic reboot */ down_level[0] = '6'; break; + case 'l': /* Automatic reboot without qreboot */ + down_level[0] = '5'; + break; case 'h': /* Halt after shutdown */ down_level[0] = '0'; break; @@ -458,6 +463,9 @@ switch(down_level[0]) { case '0': strcpy(newstate, "for system halt"); + break; + case '5': + strcpy(newstate, "for reboot without qreboot"); break; case '6': strcpy(newstate, "for reboot"); Only in sysvinit/src: shutdown.c.orig