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

Busybox netcat doesn't support connecting to UNIX sockets, but is found before netcat-openbsd #87

Closed
ericonr opened this issue Nov 13, 2024 · 4 comments · Fixed by #84
Closed
Assignees

Comments

@ericonr
Copy link
Member

ericonr commented Nov 13, 2024

#72 made it necessary to call docker exec -ti container nc.openbsd -U ioc.sock to access an iocsh launched by lnls-run, because using nc instead uses the busybox version, which doesn't work.

I would consider reverting the commit (almost) entirely and using busybox wget in the download step; otherwise we'd have to cleanup some specific part of busybox --install.

@henriquesimoes
Copy link
Collaborator

Yeah, my bad. I should've tested with lnls-run, and that way of connecting with the socket.

I would consider reverting the commit (almost) entirely and using busybox wget in the download step; otherwise we'd have to cleanup some specific part of busybox --install.

Okay. Makes sense. Symbolic linking those that have all features we expect them to have is still desired in the end? If not, I'd be okay to rather document that users have busybox available in resulting images, and that they are encouraged to check its built-in commands before attempting to install any extra package.

@ericonr
Copy link
Member Author

ericonr commented Nov 13, 2024

No worries :)

Symbolic linking those that have all features we expect them to have is still desired in the end?

I think so. It is useful, and helps a different use case from mine. We could do unlink /path/to/busybox/nc; or document that accessing the iocsh requires nc.openbsd (I don't like this option).

@henriquesimoes
Copy link
Collaborator

We could do unlink /path/to/busybox/nc;

I'll try that one.

or document that accessing the iocsh requires nc.openbsd (I don't like this option).

Neither do I.

@henriquesimoes
Copy link
Collaborator

henriquesimoes commented Nov 13, 2024

Okay. That's more interesting than I thought. Things are broken due to /bin and /usr/bin being two separate things in Debian 11, and busybox --install and update-alternatives not being consistent with each other. Inside a fresh debian:11.9 container:

$ apt update && apt install -y busybox netcat-openbsd
$ ls -i /bin/busybox /bin/nc /usr/bin/nc
ls: cannot access '/usr/bin/nc': No such file or directory
15619228 /bin/busybox  15619314 /bin/nc
$ busybox --install
$ ls -i /bin/busybox /bin/nc /usr/bin/nc
15619228 /bin/busybox  15619314 /bin/nc  15619228 /usr/bin/nc
$ realpath /bin/nc
/bin/nc.openbsd
$ which nc
/usr/bin/nc

I think this will be solved by migrating to Debian 12, which should install usrmerge. Indeed, this is what we get:

$ apt update && apt install -y busybox netcat-openbsd
$ ls -i /bin/busybox /bin/nc /usr/bin/nc
15990847 /bin/busybox  15990922 /bin/nc  15990922 /usr/bin/nc
$ busybox --install
$ ls -i /bin/busybox /bin/nc /usr/bin/nc
15990847 /bin/busybox  15990922 /bin/nc  15990922 /usr/bin/nc
$ realpath /bin/nc
/usr/bin/nc.openbsd
$ which nc
/usr/bin/nc

@henriquesimoes henriquesimoes linked a pull request Nov 13, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants