Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Chroot never exiting #36

Open
Azkali opened this issue Mar 6, 2021 · 0 comments
Open

Chroot never exiting #36

Azkali opened this issue Mar 6, 2021 · 0 comments

Comments

@Azkali
Copy link

Azkali commented Mar 6, 2021

Hi I am currently trying to use your module to bootstrap distributions. I am using a Popen wrapper to run the commands in the chroot. The command run successfully but the never exit the chroot.

Environment : Python 3.8.7 | Kernel 5.9.12 | Gentoo

Popen wrapper :

def run(cmd):
    ''' subprocess.Popen wrapper '''
    process = Popen(cmd, universal_newlines=True,
        shell=True, stdout=PIPE,stderr=STDOUT)
    while True:
        output = process.stdout.readline()
        if output == '' and process.poll() is not None:
            break
        if output:
            print(output.strip())
    rc = process.poll()
    return rc

Chroot :

        chroot = Chroot(self.distro_dir)
        with chroot:
            print("Chrooting in {}".format(self.distro_dir))
            for cmd in self.script:
                run(cmd)
            print("Chroot process done !")
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant