fix(alpine): fix glibc busybox sync and missing /usr/bin/ionice+nice for musl builds - #3598
Open
AdaAibaby wants to merge 2 commits into
Open
fix(alpine): fix glibc busybox sync and missing /usr/bin/ionice+nice for musl builds#3598AdaAibaby wants to merge 2 commits into
AdaAibaby wants to merge 2 commits into
Conversation
Two bugs that cause Alpine template builds to fail at the base layer: 1. SyncChangesToDisk called rootfs.SandboxBusyBoxPath (glibc-linked /usr/bin/busybox) which cannot execute on Alpine musl; replace with plain "sync" + explicit PATH. 2. envd OOM wrapper hard-codes /usr/bin/ionice and /usr/bin/nice. util-linux-misc installs ionice to /bin/ionice (not /usr/bin) and busybox ships nice to /bin/nice. Add symlinks in the Alpine InitOpenRC provisioning step so the paths resolve.
AdaAibaby
requested review from
ValentaTomas,
dobrac and
jakubno
as code owners
August 23, 2026 09:20
Without devpts mounted at /dev/pts, opening /dev/ptmx fails with ENOENT. Add an early ::sysinit inittab entry (before OpenRC sysinit) that mounts devpts and creates /dev/ptmx via mknod as a fallback if devtmpfs did not auto-create it. Required for e2b terminal / PTY connections to work.
Contributor
Author
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
Fixes #3597
Three bugs cause Alpine template builds/sandboxes to fail.
Changes
1.
sandboxtools/command.go— fixSyncChangesToDiskfor musl/AlpineSyncChangesToDiskwas invoking/usr/bin/busybox sync(glibc-linked, injected by e2b). On Alpine (musl libc) this binary cannot be executed. Replace with plainsync+ an explicitPATHso any distro's nativesyncis found.2.
distro/init.go— add/usr/bin/{ionice,nice}symlinks in Alpine InitOpenRCenvd's OOM wrapper hard-codes
/usr/bin/ioniceand/usr/bin/nice. On Alpine:util-linux-miscinstallsioniceto/bin/ionice(not/usr/bin/ionice)niceis only at/bin/nice(busybox symlink)Verified:
docker run --rm alpine:3.22 sh -c 'apk add --no-cache util-linux-misc >/dev/null 2>&1; ls /usr/bin/ionice /usr/bin/nice 2>&1'→ bothNo such file or directory. Without symlinks every command envd spawns during the step layer exits 127.3.
distro/init.go— mount devpts + ensure/dev/ptmxexists at bootWithout devpts mounted at
/dev/pts, opening/dev/ptmxfails withENOENT, breaking all PTY/terminal connections (e2b sbx crreturnsopen /dev/ptmx: no such file or directory).On Alpine with busybox init + OpenRC: devtmpfs may not auto-mount
/dev/ptmx, and OpenRC'sdevfsservice does not mount devpts. Add an early::sysinitinittab entry (runs beforeopenrc sysinit) that:/dev/pts/dev/ptmxviamknodas a fallback if devtmpfs hasn't created itTest plan
exit status 127e2b sbx cr <alpine-template>— terminal connects successfully (no/dev/ptmxerror)