Skip to contentSkip to conversation

dynamic logger binary

PATCH New Olaf Hering 1 participant 1 message Jun 6, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dynamic logger binary

Hi,

we have the logger in /bin ...
log also the pid to tracing.

Index: etc/hotplug/hotplug.functions
=================================RCS file: /cvsroot/linux-hotplug/admin/etc/hotplug/hotplug.functions,v retrieving revision 1.17

hotplug/hotplug.functions +9 -2
diff -u -r1.17 hotplug.functions
@@ -22,16 +21,23 @@
     . /etc/sysconfig/hotplug
 fi
 
+if [ -x /usr/bin/logger ]; then
+    LOGGER=/usr/bin/logger
+elif [ -x /bin/logger ]; then
+    LOGGER=/bin/logger
+else
+    unset LOGGER
+fi
 #
 # for diagnostics
 #
-if [ -t -o ! -x /usr/bin/logger ]; then
+if [ -t -o -z "$LOGGER" ]; then
     mesg () {
 	echo "$@"
     }
 else
     mesg () {
-	/usr/bin/logger -t $(basename $0) "$@"
+	$LOGGER -t $(basename $0)"[$$]" "$@"
     }
 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