X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshutdown.c;h=d6b47c5a7857fcab6d2e940f39e9b6145062d583;hb=2006d9acb1248e4225d31c420520c043b1ae044d;hp=0905ef5b3a96ab5523d9aa5a26db1814e1f64085;hpb=3b8a1f3fee7bf83af5bbae541166508cf172b67c;p=elogind.git diff --git a/src/shutdown.c b/src/shutdown.c index 0905ef5b3..d6b47c5a7 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;