Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow to choose between busybox and util-linux-misc eject #171

Open
klaernie opened this issue Mar 22, 2023 · 3 comments
Open

allow to choose between busybox and util-linux-misc eject #171

klaernie opened this issue Mar 22, 2023 · 3 comments

Comments

@klaernie
Copy link

It would be nice if there was a env var to configure the eject binary being used.

I am running this image with podman instead of docker. The default is running containers rootless, which I prefer.
With running rootless also comes another problem: the container runtime cannot create devices with mknod, but needs to resort to bind-mounting the device in. This leads to each mounted device being listed in /proc/mounts as a mountpoint.

/ # mount |grep /dev/sr0
udev on /dev/sr0 type devtmpfs (rw,nosuid,noexec,relatime,size=49342912k,nr_inodes=12335728,mode=755,inode64)
/ #

The eject command from util-linux-misc dutyfully checks /proc/mounts to see if the user provided a mountpoint or a device, and if it finds the argument given as a mountpoint, it tries to umount and eject the device obtained from /proc/mounts.

Exactly this now condition leads to eject failing with the message:

/ # eject -v /dev/sr0
eject: device name is `/dev/sr0'
eject: udev: mounted on /dev/sr0
eject: udev: not found mountpoint or device with the given name
/ #

But luckily busybox's eject command is much more direct and just calls the ioctl, explicitly not checking /proc/mounts.

Ideally I'd like to have an environment variable, that allows me to choose the eject command to be either eject "$DRV_DEV" or busybox eject "$DRV_DEV".

Thanks and best regards,
Andre

PS: thank you very much for building and maintaining this container, it easily saved me hours in getting makemkv to work!

@spider-one
Copy link

Ah, this probably explains my exact issue but I haven't had time to delve into it. I am also using Podman on Fedora IoT 38 and not able to get the container to eject the drive after auto rip. Hope to see this change implemented in some fashion to improve compatibility.

@jlesage
Copy link
Owner

jlesage commented Sep 20, 2024

Could you try method described in #215 to see if it's working for you ?

@klaernie
Copy link
Author

Could you try method described in #215 to see if it's working for you ?

Sorry it took so long to try - yes, using sg_raw /dev/sr0 1b 00 00 00 02 00 works well, but it of cause requires installing sg3_utils, while using busybox's eject command does not. Looking at the error messages presented in #84 it looks like Synology too uses mounts to bring the device files into the container instead of creating real block devices, hence fails with the same reason as I reported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants