Ticket #1646 (closed defect: wontfix)
$PATH not correctly honoured by the shell?
| Reported by: | Strolls | Owned by: | openmoko-devel |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | unknown | Version: | |
| Severity: | blocker | Keywords: | |
| Cc: | Blocked By: | ||
| Blocking: | Estimated Completion (week): | ||
| HasPatchForReview: | no | PatchReviewResult: | |
| Reproducible: |
Description
Using 2007.2 (default factory image, then opkg update && opkg upgrade) $PATH does not seem to be honoured by the shell.
root@om-gta02:~# shutdown -fh now -sh: shutdown: not found root@om-gta02:~# find / -name shutdown /usr/lib/opkg/alternatives/shutdown /sbin/shutdown root@om-gta02:~# echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin: root@om-gta02:~# /sbin/shutdown -fh now Broadcast message from root (pts/0) (Sun Jul 20 12:21:16 2008): The system is going down for system halt NOW! root@om-gta02:~# Connection to 192.168.0.202 closed by remote host. Connection to 192.168.0.202 closed. $
Maybe I'm doing something wrong here. I first noticed this running /usr/bin/screen, and because that wipes the terminal when it starts it's a bit difficult to copy & paste the output to document it. ;) The weird thing is that screen seems to *intermittently* give this "-sh: screen: not found" error - it seems like when my Freerunner is first powered up it works fine (typing only screen or screen -Rd), then if I log out and connect again after a day or so, I have to use the full path to screen. This behaviour with shutdown seems consistent, however.
`
Change History
comment:2 follow-up: ↓ 4 Changed 5 years ago by haduong@…
I too get PATH issues when I login as myself, then do an su to root. Root has a non-empty password here. This prevents some opkg post-install procedures, as I get errors like:
Configuring kernel-module-hci-usb //usr/lib/opkg/info/kernel-module-hci-usb.postinst: line 11: modprobe: not found Configuring kernel-module-usbserial /tmp/opkg-intercept-1498-0/update-modules: line 1: update-modules: not found update-modules: No such file or directory /tmp/opkg-intercept-1498-0/depmod: line 1: depmod: not found depmod: Illegal seek
A workaround is to ssh as root directly.
comment:3 Changed 5 years ago by andy
Take care to use
su -
not just su. The - makes sure you get root's environment not your original user one.
comment:4 in reply to: ↑ 2 Changed 5 years ago by Strolls
Replying to haduong@centre-cired.fr:
I too get PATH issues when I login as myself, then do an su to root.
That's weird - I get the problem when I ssh in as root. You cannot reproduce that?

I've noticed something similar: when I run "screen" PATH is not exported. Once I got the same problem as you, and "export PATH" fixed it (however I do not always get the problem)
Not having a PATH also crashes opkg.
To know whether PATH is exported, you can do: