[systemd-devel] [PATCH] src/shutdown.c: initialize the controlling terminal

harald at redhat.com harald at redhat.com
Tue Jul 19 03:47:45 PDT 2011


From: Harald Hoyer <harald at redhat.com>

Thanks Kay Sievers!
---
 src/shutdown.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/shutdown.c b/src/shutdown.c
index 0905ef5..d6b47c5 100644
--- a/src/shutdown.c
+++ b/src/shutdown.c
@@ -276,6 +276,9 @@ static int pivot_to_new_root(void) {
                 log_error("Failed to open /dev/console: %m");
         else {
                 make_stdio(fd);
+		/* initialize the controlling terminal */
+		setsid();
+		ioctl(0, TIOCSCTTY, NULL);
         }
 
         return 0;
-- 
1.7.6



More information about the systemd-devel mailing list