* Make sure that when we open devices we use O_NOCTTY, since otherwise when run under Upstart we end up with controlling terminals that we didn't expect. * Then after we've forked into a child process, we call the TIOCSCTTY ioctl() to take control of the terminal we're on so we get input.