Skip to content

Failure on hosts without /usr/bin/env (e.g. Talos) #858

Description

@bluecmd

Hi,

Using Talos - and it does not have /usr/bin/env (see siderolabs/talos#11469).

This means that the chroot-host-wrapper.sh script does not work, specifically this line:

exec chroot $DIR /usr/bin/env -i PATH="/sbin:/bin:/usr/bin:/usr/sbin" ${ME} "${@:1}"

Instead, consider doing something like:

HOST_BIN="$(/usr/bin/env -i PATH="/host/sbin:/host/bin:/host/usr/bin:/host/usr/sbin" /usr/bin/which ${ME})"
exec chroot $DIR /usr/bin/env -i PATH="/sbin:/bin:/usr/bin:/usr/sbin" "${HOST_BIN#/host}" "${@:1}"

This would do the path resolution inside the container and not rely on the host utils for that.

Logs for completeness sake:

026-04-13 21:22:38,4139 DEBUG  [117] [SVC:14;60050764008581B6A800000000000010] (executer.go:75) - Executing command : {iscsiadm} with args : {[-m session]}. and timeout : {30000} mseconds
2026-04-13 21:22:38,4139 DEBUG  [117] [SVC:14;60050764008581B6A800000000000010] (executer.go:69) - Non-zero exit code: exit status 127
2026-04-13 21:22:38,4139 DEBUG  [117] [SVC:14;60050764008581B6A800000000000010] (executer.go:82) - Output from command: chroot: failed to run command '/usr/bin/env': No such file or directory

2026-04-13 21:22:38,4139 DEBUG  [117] [SVC:14;60050764008581B6A800000000000010] (executer.go:86) - Finished executing command 
2026-04-13 21:22:38,4139 DEBUG  [117] [SVC:14;60050764008581B6A800000000000010] (executer.go:121) - No active iSCSI sessions

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