Ticket #1646 (closed defect: wontfix)

Opened 11 years ago

Last modified 10 years ago

$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:


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
root@om-gta02:~# echo $PATH
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 closed by remote host.
Connection to 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:1 Changed 11 years ago by chgros

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:

env | grep PATH

comment:2 follow-up: ↓ 4 Changed 11 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 11 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 11 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?

comment:5 Changed 11 years ago by haduong@…

Regarding my problem, Andy's reply shows that it's a feature, not a bug. Thread closed.

Regarding your problem, no I can't reproduce. $PATH is set allright when I login as root or "su -".

comment:6 Changed 10 years ago by john_lee

  • Status changed from new to closed
  • HasPatchForReview unset
  • Resolution set to wontfix
Note: See TracTickets for help on using tickets.