From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aras Vaichas Date: Thu, 01 Dec 2005 04:34:20 +0000 Subject: Re: problem with PROGRAM Message-Id: <438E7D4C.4030304@magellan-technology.com> List-Id: References: <438D4B0F.5050303@magellan-technology.com> In-Reply-To: <438D4B0F.5050303@magellan-technology.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Kay Sievers wrote: > On Wed, Nov 30, 2005 at 10:43:30AM -0600, linas wrote: >>I am guessing/hoping that quotes are escaped, so that the >>following might work: >> >>ACTION="remove", PHYSDEVDRIVER="usbnet", PROGRAM="/bin/sh -c \"/usr/bin/cat >>/var/run/autoipd-usb0.pid | /usr/bin/xargs /bin/kill\" " > > > No, escaping will not work, you need an external script. And PHYSDEVDRIVER > is not a key, udev will recognize, it is just ignored, you probably want > ENV{PHYSDEVDRIVER}=. I took a look at udev_tools_run.c and I see why it doesn't work. I understand why it shouldn't work the way I was trying to make it work either. Thanks. I also realised that running autoipd was leaving a zombie process that was stopping my remove rule from executing. rule: KERNEL="usb[0-9]", ACTION="add", ENV{PHYSDEVDRIVER}="usbnet", PROGRAM="/etc/udev/scripts/start_autoipd.sh %k" start_autoipd.sh: logger "$0 is attempting to start autoipd -i $1" autoipd -i $1 logger "$0 successful" exit 0 plug in the USB ethernet device: /var/log/messages: logger: /etc/udev/scripts/start_autoipd.sh is attempting to start autoipd -i usb0 logger: /etc/udev/scripts/start_autoipd.sh successful # ps ax | grep autoipd 30554 ? Z< 0:00 [start_autoipd.s] 30557 ? S