[Pkg-sysvinit-commits] r1441 - in sysvinit-upstream/trunk: doc src

Petter Reinholdtsen pere at alioth.debian.org
Sun Jul 12 13:21:42 UTC 2009


Author: pere
Date: 2009-07-12 13:21:42 +0000 (Sun, 12 Jul 2009)
New Revision: 1441

Modified:
   sysvinit-upstream/trunk/doc/Changelog
   sysvinit-upstream/trunk/src/init.c
   sysvinit-upstream/trunk/src/sulogin.c
Log:
Modify init and sulogin to fix emergency mode's tty, making sure ^C
and ^Z work when booting with 'emergency' kernel option.  Patch from
Samuel Thibault.


Modified: sysvinit-upstream/trunk/doc/Changelog
===================================================================
--- sysvinit-upstream/trunk/doc/Changelog	2009-07-11 17:59:13 UTC (rev 1440)
+++ sysvinit-upstream/trunk/doc/Changelog	2009-07-12 13:21:42 UTC (rev 1441)
@@ -54,6 +54,9 @@
   * Add usleep in killall5 after killing processes, to force the kernel
     to reschedule.  Patch from SuSe.
   * Modify pidof to not print empty line if no pid was found.
+  * Modify init and sulogin to fix emergency mode's tty, making sure ^C
+    and ^Z work when booting with 'emergency' kernel option.  Patch from
+    Samuel Thibault.
 
  -- Petter Reinholdtsen <pere at debian.org>  Fri, 30 Jul 2004 14:14:58 +0200
 

Modified: sysvinit-upstream/trunk/src/init.c
===================================================================
--- sysvinit-upstream/trunk/src/init.c	2009-07-11 17:59:13 UTC (rev 1440)
+++ sysvinit-upstream/trunk/src/init.c	2009-07-12 13:21:42 UTC (rev 1441)
@@ -94,7 +94,7 @@
 CHILD *newFamily = NULL;	/* The list after inittab re-read */
 
 CHILD ch_emerg = {		/* Emergency shell */
-	0, 0, 0, 0, 0,
+	WAITING, 0, 0, 0, 0,
 	"~~",
 	"S",
 	3,

Modified: sysvinit-upstream/trunk/src/sulogin.c
===================================================================
--- sysvinit-upstream/trunk/src/sulogin.c	2009-07-11 17:59:13 UTC (rev 1440)
+++ sysvinit-upstream/trunk/src/sulogin.c	2009-07-12 13:21:42 UTC (rev 1441)
@@ -23,6 +23,7 @@
 #include <pwd.h>
 #include <shadow.h>
 #include <termios.h>
+#include <errno.h>
 #include <sys/ioctl.h>
 #if defined(__GLIBC__)
 #  include <crypt.h>
@@ -447,6 +448,11 @@
 			} else
 				close(fd);
 		}
+	} else if (getpid() == 1) {
+		/* We are init. We hence need to set a session anyway */
+		setsid();
+		if (ioctl(0, TIOCSCTTY, (char *)1))
+			perror("ioctl(TIOCSCTTY)");
 	}
 
 	/*




More information about the Pkg-sysvinit-commits mailing list