Re: su: Cannot drop the controlling terminal

"Xi Ruoyao" ([email protected] via lfs-support Mailing List) <[email protected]>
Newsgroups gmane.linux.lfs.support
Message-ID <[email protected]>
On Fri, 2024-12-13 at 15:00 -0600, Bruce Dubbs wrote:
> On 12/13/24 12:54, "Ray" ([email protected] via lfs-support Mailing List) wrote:
> > Hi all,
> > 
> > In the chroot environment I see the following error when trying  to run the
> > tests as the tester user.
> > 
> > su: Cannot drop the controlling terminal

                int err = -1;

#ifdef USE_PAM
                /* When PAM is used, we are on the child */
                err = setsid ();
#else
                /* Otherwise, we cannot use setsid */
                int fd = open ("/dev/tty", O_RDWR);

                if (fd >= 0) {
                        err = ioctl (fd, TIOCNOTTY, (char *) NULL);
                        (void) close (fd);
                } else if (ENXIO == errno) {
                        /* There are no controlling terminal already */
                        err = 0;
                }
#endif                          /* USE_PAM */

                if (-1 == err) {
                        (void) fprintf (stderr,
                                        _("%s: Cannot drop the controlling terminal\n"),
                                        Prog);
                        exit (1);
                }

We don't have PAM here, so USE_PAM should be undefined.

Now it looks to me $LFS/dev isn't mounted correctly (so /dev/tty is
unavailable in the chroot).  But IIRC it should already cause some
packages fail to build before the first attempt to use su.


-- 
Xi Ruoyao <[email protected]>
School of Aerospace Science and Technology, Xidian University

-- 
http://lists.linuxfromscratch.org/sympa/info/lfs-support
Unsubscribe: See the above information page
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.