Skip to contentSkip to conversation

introduce etc/sysconfig/hotplug, move debug to the new file

PATCH In review Olaf Hering 1 participant 2 messages Jun 7, 2003 – Jun 8, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 introduce etc/sysconfig/hotplug, move debug to the new file

This one introduces etc/sysconfig/hotplug and moves the DEBUG settings to this file.

Index: etc/hotplug/net.agent
=================================--- etc/hotplug/net.agent (revision 14)
+++ etc/hotplug/net.agent (working copy)
@@ -18,7 +18,6 @@

cd /etc/hotplug
. hotplug.functions
-# DEBUG=yes export DEBUG

if [ "$INTERFACE" = "" ]; then
mesg Bad NET invocation: \$INTERFACE is not set
Index: etc/hotplug/ieee1394.agent
=================================--- etc/hotplug/ieee1394.agent (revision 14)
+++ etc/hotplug/ieee1394.agent (working copy)
@@ -25,7 +25,6 @@

cd /etc/hotplug
. hotplug.functions
-# DEBUG=yes export DEBUG

 # generated by modutils 2.4.9 or later, for 2.4.10 and later kernels
 MAP_CURRENT=$MODULE_DIR/modules.ieee1394map
Index: etc/hotplug/usb.agent
=================================--- etc/hotplug/usb.agent	(revision 14)
+++ etc/hotplug/usb.agent	(working copy)
@@ -80,7 +80,6 @@

cd /etc/hotplug
. hotplug.functions
-# DEBUG=yes export DEBUG

 # generated by modutils, for current 2.4.x (and later) kernels
 MAP_CURRENT=$MODULE_DIR/modules.usbmap
Index: etc/hotplug/hotplug.functions
=================================--- etc/hotplug/hotplug.functions	(revision 14)
+++ etc/hotplug/hotplug.functions	(working copy)
@@ -10,7 +10,6 @@
 #
 #

-# DEBUG=yes; export DEBUG
PATH=/bin:/sbin:/usr/sbin:/usr/bin

KERNEL=uname -r
@@ -43,7 +42,7 @@
fi

debug_mesg () {
- test "$DEBUG" = "" -o "$DEBUG" = no && return
+ test "$HOTPLUG_DEBUG" = "" -o "$HOTPLUG_DEBUG" = no && return

     mesg "$@"

}

Index: etc/hotplug.d/default/default.hotplug
=================================--- etc/hotplug.d/default/default.hotplug (revision 14)
+++ etc/hotplug.d/default/default.hotplug (working copy)
@@ -26,8 +26,6 @@
cd /etc/hotplug
. hotplug.functions

-# DEBUG=yes export DEBUG
-
debug_mesg "arguments ($*) env (env)"

#
@@ -64,9 +62,7 @@
AGENT=/etc/hotplug/$1.agent
if [ -x $AGENT ]; then
shift
- if [ "$DEBUG" != "" ]; then
- mesg "invoke $AGENT ($@)"
- fi
+ test "$HOTPLUG_DEBUG" = "" -o "$HOTPLUG_DEBUG" = no || mesg "invoke $AGENT ($@)"
exec $AGENT "$@"
mesg "couldn't exec $AGENT"
exit 1
Index: etc/sysconfig/hotplug
=================================--- etc/sysconfig/hotplug (working copy)
+++ etc/sysconfig/hotplug (working copy)
@@ -0,0 +1,5 @@
+#####################################################################
+#
+# Enable debugging for all hotplug actions? yes/no +#
+HOTPLUG_DEBUG=no
Index: Makefile
=================================--- Makefile (revision 14)
+++ Makefile (working copy)
@@ -83,6 +83,7 @@

install:
${INSTALL_SCRIPT} -D sbin/hotplug $(sbindir)/hotplug
+ $(INSTALL) -d $(etcdir)/sysconfig
$(INSTALL) -d $(etcdir)/hotplug/{usb,pci}
$(INSTALL) -D etc/hotplug.d/default/default.hotplug $(etcdir)/hotplug.d/default/default.hotplug for F in etc/hotplug/{*.{agent,rc},hotplug.functions} ; do \
@@ -91,6 +92,7 @@
for F in etc/hotplug/{blacklist,usb.{user,hand,dist}map} ; do \
${INSTALL_DATA} $$F $(etcdir)/hotplug ; \
done
+ @test -f $(etcdir)/sysconfig/hotplug || $(INSTALL)/etc/sysconfig/hotplug $(etcdir)/sysconfig/hotplug
${INSTALL_SCRIPT} -D etc/rc.d/init.d/hotplug $(etcdir)/init.d/hotplug $(INSTALL_DATA) -D hotplug.8 $(mandir)/man8/hotplug.8
$(INSTALL) -d $(prefix)/var/log/hotplug $(prefix)/var/run

Signature · 11 lines
USB is for mice, FireWire is for men!


-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#1 lore raw
Quoted 2 lines · Olaf Hering

This one introduces etc/sysconfig/hotplug and moves the DEBUG settings to this file.

In case this one gets merged, Debian has it in /etc/default. Neither FHS nor LSB seem to define the system config location for packages.

Index: etc/hotplug/hotplug.functions
=================================--- etc/hotplug/hotplug.functions (revision 15)
+++ etc/hotplug/hotplug.functions (working copy)
@@ -17,6 +17,9 @@

HOTPLUG_DIR=/etc/hotplug

+if [ -f /etc/default/hotplug ]; then
+ . /etc/default/hotplug
+fi
if [ -f /etc/sysconfig/hotplug ]; then
. /etc/sysconfig/hotplug
fi

Signature · 11 lines
USB is for mice, FireWire is for men!


-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel