hotplug: call handle_device.d/ actions for remove
authorOron Peled <oron.peled@xorcom.com>
Sun, 9 Mar 2014 12:03:00 +0000 (14:03 +0200)
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>
Tue, 25 Mar 2014 12:48:09 +0000 (14:48 +0200)
* Original actions didn't care about remove (10-span-types, 20-span-assignments)
* But others need to know about removals too.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

hotplug/dahdi_handle_device
hotplug/handle_device.d/10-span-types
hotplug/handle_device.d/20-span-assignments

index 52ce9c2..30329bd 100755 (executable)
@@ -77,8 +77,9 @@ add)
        run_parts 2>&1 < /dev/null | $LOGGER &
        ;;
 remove)
-       # Nothing to do yet...
        echo "$ACTION: $DEVPATH" | $LOGGER
+       # Background run -- don't block udev
+       run_parts 2>&1 < /dev/null | $LOGGER &
        ;;
 *)
        echo "UNHANDLED: $ACTION: $DEVPATH" | $LOGGER
index d840c3d..6b78021 100755 (executable)
@@ -1,5 +1,12 @@
 #! /bin/sh
 
+case "$ACTION" in
+add)
+       ;;
+*)
+       exit 0
+esac
+
 if [ -r "$DAHDICONFDIR/span-types.conf" ]; then
        dahdi_span_types set "/sys$DEVPATH"
 fi
index f078aca..bfb724b 100755 (executable)
@@ -1,5 +1,12 @@
 #! /bin/sh
 
+case "$ACTION" in
+add)
+       ;;
+*)
+       exit 0
+esac
+
 if [ -r "$DAHDICONFDIR/assigned-spans.conf" ]; then
        dahdi_span_assignments add "/sys$DEVPATH"
 else