FS#18953 - [initscripts] udev incorrect $PATH passed to helpers
Attached to Project:
Arch Linux
Opened by orbisvicis (orbisvicis) - Saturday, 03 April 2010, 23:53 GMT
Last edited by Andrea Scarpino (BaSh) - Wednesday, 22 December 2010, 22:31 GMT
Opened by orbisvicis (orbisvicis) - Saturday, 03 April 2010, 23:53 GMT
Last edited by Andrea Scarpino (BaSh) - Wednesday, 22 December 2010, 22:31 GMT
|
Details
Description:
The $PATH udev inherits and passes to helper applications is incomplete: /usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:. Additional info: * package version(s) core/udev 151-3 (base) Steps to reproduce: in one of the /lib/udev/* helper scripts add: logger "gpsd.hotplug.wrapper path is: $PATH" |
This task depends upon
Closed by Andrea Scarpino (BaSh)
Wednesday, 22 December 2010, 22:31 GMT
Reason for closing: Fixed
Additional comments about closing: http://projects.archlinux.org/initscript s.git/commit/?id=b1f25405aeb7baff194aac4 473c8c6692c3d8bea
Wednesday, 22 December 2010, 22:31 GMT
Reason for closing: Fixed
Additional comments about closing: http://projects.archlinux.org/initscript s.git/commit/?id=b1f25405aeb7baff194aac4 473c8c6692c3d8bea
Since /etc/profile is sourced after the boot-up process, it doesn't affect the $PATH that udev inherits.
I see two ways to modify the $PATH udev inherits:
in /etc/rc.sysinit (and possibly also in rc.single) call udev as
PATH="..." /sbin/udevd --daemon
^ does this need to be prefixed with "export"?
in /lib/udev/rules.d/ add a rule "00-paths.rule" containing
ACTION=="*", ENV{PATH}="..."
First to consider: is it a good idea to change udev's $PATH? If so, is it preferable to set the $PATH correctly for all applications in /etc/rc.sysinit, or only for udev? (this would render /etc/profile a bit redundant)
Which scripts, in particular, are failing here? Just use the full path and everything works fine.
There is no single unified place to define the system PATH. It's based on the shell
For example - possibly the only example - the gpsd helper program "/lib/udev/gpsd.hotplug" needs modification.
Line 49 @ http://repos.archlinux.org/wsvn/community/gpsd/trunk/PKGBUILD
sed -i 's|gpsdcmd = "gpsd %s|gpsdcmd = "/usr/sbin/gpsd %s|' gpsd.hotplug
The reason bash is using its default path is that it is started non-interactively without a parent process giving it a PATH.
How do we change this? No idea. Please look into how the other distros you referenced do it. My guess is that they set BASH_ENV, or perhaps even export PATH before calling init for the first time.
Let me know if there is a problem. If it does not work it is a bug in either systemd or udev (or the provider of the helper script), which I'd like to file upstream.