[Pkg-sysvinit-commits] r1047 - in sysvinit/trunk/debian: . patches

Petter Reinholdtsen pere at alioth.debian.org
Sat Jan 13 11:12:10 CET 2007


Author: pere
Date: 2007-01-13 11:12:09 +0100 (Sat, 13 Jan 2007)
New Revision: 1047

Modified:
   sysvinit/trunk/debian/changelog
   sysvinit/trunk/debian/patches/66_init_emerg_tty.dpatch
Log:
  * Replace 66_init_emerg_tty patch with one only creating a new
    session group when sulogin is called directly from init, and not
    as part of the runlevel start scripts, to avoid leaving the single
    user shell behind when switching runlevel.  Updated patch from Samuel
    Thibault. (Closes:406587)

Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog	2006-11-28 18:57:13 UTC (rev 1046)
+++ sysvinit/trunk/debian/changelog	2007-01-13 10:12:09 UTC (rev 1047)
@@ -1,3 +1,13 @@
+sysvinit (2.86.ds1-37~1) unstable; urgency=low
+
+  * Replace 66_init_emerg_tty patch with one only creating a new
+    session group when sulogin is called directly from init, and not
+    as part of the runlevel start scripts, to avoid leaving the single
+    user shell behind when switching runlevel.  Updated patch from Samuel
+    Thibault. (Closes:406587)
+
+ -- Petter Reinholdtsen <pere at debian.org>  Sat, 13 Jan 2007 11:04:36 +0100
+
 sysvinit (2.86.ds1-36) unstable; urgency=medium
 
   * Medium urgency as it solve some RC bugs in etch.

Modified: sysvinit/trunk/debian/patches/66_init_emerg_tty.dpatch
===================================================================
--- sysvinit/trunk/debian/patches/66_init_emerg_tty.dpatch	2006-11-28 18:57:13 UTC (rev 1046)
+++ sysvinit/trunk/debian/patches/66_init_emerg_tty.dpatch	2007-01-13 10:12:09 UTC (rev 1047)
@@ -31,28 +31,17 @@
  #include <sys/ioctl.h>
  #if defined(__GLIBC__)
  #  include <crypt.h>
-@@ -410,7 +411,6 @@
- 				if (pid != getsid(0)) {
- 					if (pid == getpgid(0))
- 						setpgid(0, getpgid(getppid()));
--					setsid();
- 				}
- 
- 				signal(SIGHUP, SIG_IGN);
-@@ -421,13 +421,15 @@
- 				close(2);
- 				close(fd);
- 				fd = open(tty, O_RDWR);
--				ioctl(0, TIOCSCTTY, (char *)1);
- 				dup(fd);
- 				dup(fd);
+@@ -427,7 +428,12 @@
  			} else
  				close(fd);
  		}
- 	}
-+	setsid();
-+	if (ioctl(0, TIOCSCTTY, (char *)1))
-+		perror("ioctl(TIOCSCTTY)");
+-	}
++	} 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)");
++	}
  
  	/*
  	 *	Get the root password.




More information about the Pkg-sysvinit-commits mailing list