Skip to contentSkip to conversation

REMOVE_CMD went missing during remove action events

DISCUSSION Aras Vaichas 1 participant 1 message Aug 29, 2008

lore
Share & tools
lore
#0 lore raw

I've started to use REMOVE_CMD in my udev scripts, but during my testing I've noticed that the REMOVE_CMD doesn't get called.

Here is my udev rule which matches on a USB Bluetooth device, calls the start function, and queues up the stop function via the REMOVE_CMD environment variable.

ACTION="add", KERNEL="hci[0-9]*", SUBSYSTEM="bluetooth", ENV{REMOVE_CMD}="/etc/init.d/bluetooth stop", RUN+="/etc/init.d/bluetooth start"

When the device is removed, the REMOVE_CMD environment variable is missing. Is this expected behaviour?

# insert Bluetooth device, REMOVE_CMD is defined
UDEV  [883618587.004419] add     
/devices/platform/at91_ohci/usb1/1-1/1-1:1.0/hci0 (bluetooth)
UDEV_LOG=3
ACTION­d
DEVPATH=/devices/platform/at91_ohci/usb1/1-1/1-1:1.0/hci0
SUBSYSTEM=bluetooth
SEQNUMW5
UDEVD_EVENT=1
REMOVE_CMD=/etc/init.d/bluetooth stop
# remove Bluetooth device, REMOVE_CMD is missing
UDEV  [883618588.926582] remove  
/devices/platform/at91_ohci/usb1/1-1/1-1:1.0/hci0 (bluetooth)
UDEV_LOG=3
ACTION=remove
DEVPATH=/devices/platform/at91_ohci/usb1/1-1/1-1:1.0/hci0
SUBSYSTEM=bluetooth
SEQNUMX6
UDEVD_EVENT=1

Aras

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email
______________________________________________________________________