[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Problem with udev/ifupdown (PATH is not set)
From:       Ignacio_García_Pérez <iggarpe () terra ! es>
Date:       2007-11-27 11:41:33
Message-ID: 474C026D.6030004 () terra ! es
[Download RAW message or body]

I want udevd to automatically set up any SLIP interface as soon as it
shows up (which is done using slattach), so I have this simple rule:

(actually, this will bring up ANY network interface as soon as it shows up)



ACTION=="add", SUBSYSTEM=="net", RUN+="/sbin/ifdown $env{INTERFACE}"



But it doesn't work. It turns out that udevd does not set the PATH
environment variable for the external programs it runs. Since ifupdown
calls several exteral programs (ifconfig, route, etc) WITHOUT specifying
their path, they are simply not found and the whole thing does not work
at all.

The following rule solves the problem:



ACTION=="add", SUBSYSTEM=="net",
ENV{PATH}="/usr/sbin:/usr/bin:/sbin:/bin", RUN+="/sbin/ifdown
$env{INTERFACE}"



So I have a solution. But the problem is I don't think this is right.
I'm forced to first set ENV{PATH} for every rule that runs an
executable  which MIGHT call other executables.

Should udevd be setting a default PATH value?
Should ifupdown call the external programs using the complete path
(/sbin/ifconfig and such instead of just "ifconfig")?
Should ifupdown set a default PATH value before calling external
programs (at least when it detects PATH is not already set?

IMHO the third option is the one that makes most sense. Since ifupdown
as it is now does not specify complete paths to external programs, it is
actually expecting PATH to be set, but in certain situations like this
one it is not going to be set.

Nacho.


_______________________________________________
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic