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

Fails when running as root #38

@ERROR-404-NULL-NOT-FOUND

Description

sudo python
Python 3.10.10 (main, Mar  5 2023, 22:26:53) [GCC 12.2.1 20230201] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pychroot
>>> with pychroot.Chroot('/mnt/gentoo'):
...      print('test')
... 
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pychroot/utils.py", line 109, in bind
    mount(source=src, target=dest, fstype=fstype,
  File "/usr/lib/python3.10/site-packages/snakeoil/osutils/__init__.py", line 99, in _wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/snakeoil/osutils/mount.py", line 52, in mount
    raise OSError(e, os.strerror(e))
OSError: [Errno 16] Device or resource busy

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/snakeoil/contexts.py", line 133, in __enter__
    self._child_setup()
  File "/usr/lib/python3.10/site-packages/pychroot/base.py", line 105, in _child_setup
    self._mount()
  File "/usr/lib/python3.10/site-packages/pychroot/base.py", line 137, in _mount
    bind(src=source, dest=chrmount, chroot=self.path, log=self.log, **opts)
  File "/usr/lib/python3.10/site-packages/pychroot/utils.py", line 118, in bind
    raise ChrootMountError(
pychroot.exceptions.ChrootMountError: failed mounting: mount -t sysfs sysfs /mnt/gentoo/sys: Device or resource busy

[2]+  Stopped                 sudo python

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions