PATH not exported by default when used as init= shell
Bug #320188 reported by
Loïc Minier
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash (Ubuntu) |
Won't Fix
|
Undecided
|
Unassigned | ||
dash (Ubuntu) |
Won't Fix
|
Undecided
|
Unassigned | ||
debootstrap (Ubuntu) |
Fix Released
|
Low
|
Colin Watson |
Bug Description
Hi,
When using dash or bash as init= shell on the kernel command line, PATH isn't set by the kernel in init's environment and hence not in dash's or bash's environment. Both cope fine with this, but they don't export PATH for subcommands which is desirable as all commands except init have a PATH set.
One example of this is if you try to run debootstrap's second stage from such a shell: it wil fail while dpkg-installing base-files and base-passwd because dpkg wants a PATH to be set.
Bye,
To post a comment you must log in.
confirming, this bug forces me to export PATH in a qemu wrapper script (a script called /bin/installer is executed as init in this case), the code example is:
# write installer script to image
cat > $BUILDDIR/installer <<EOF
#!/bin/bash
set -e
export PATH=/bin: /sbin:/ usr/bin: /usr/sbin debootstrap --second-stage
export LC_ALL=C
/debootstrap/
....
EOF