Hello again,

The previous patch was incomplete, it was missing the mesg() calls at
the top. I replaced them with echo to stderr, as these will mostly
happen when interactively testing the helper on the command line. The
echos will also be visible in the systemd journal if gets invoked
wrongly via udev rules.

This is the complete patch, now tested with wrong and correct
invocations, with and without debugging.

I NMUed this to DELAYED/7, so if you would like to do this differently
please feel to cancel/override (or tell me and I cancel).

Thanks!

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
diff -u ifplugd-0.28/debian/changelog ifplugd-0.28/debian/changelog
--- ifplugd-0.28/debian/changelog
+++ ifplugd-0.28/debian/changelog
@@ -1,3 +1,12 @@
+ifplugd (0.28-19.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * debian/ifplugd.udev.agent: Drop using the obsolete and udev-private
+    /lib/udev/hotplug.functions and directly call logger for the debug
+    messages and echo to stderr for invalid usage. (Closes: #810116)
+
+ -- Martin Pitt <[email protected]>  Wed, 27 Apr 2016 00:34:24 +0200
+
 ifplugd (0.28-19) unstable; urgency=low
 
   * Added interface poll delay < 1sec using the new -T option. (Closes:
diff -u ifplugd-0.28/debian/ifplugd.udev.agent 
ifplugd-0.28/debian/ifplugd.udev.agent
--- ifplugd-0.28/debian/ifplugd.udev.agent
+++ ifplugd-0.28/debian/ifplugd.udev.agent
@@ -1,19 +1,15 @@
 #!/bin/sh
 # udev agent script
 
-HOTPLUGFUNCS=/lib/udev/hotplug.functions
-[ -f $HOTPLUGFUNCS ] || exit 1
-. $HOTPLUGFUNCS
-
 if [ -z "$INTERFACE" ]; then
-    mesg Bad invocation: \$INTERFACE is not set
+    echo 'Bad invocation: $INTERFACE is not set' >&2
     exit 1
 fi
 
 DAEMON_NAME=ifplugd
 DAEMON=/usr/sbin/$DAEMON_NAME
 if [ ! -x $DAEMON ]; then
-    mesg No $DAEMON_NAME executable: $DAEMON
+    echo "No $DAEMON_NAME executable: $DAEMON" >&2
     exit 1
 fi
 
@@ -21,7 +17,7 @@
 if [ -f $CFG ]; then
     . $CFG
 else
-    mesg No $DAEMON_NAME configuration file
+    echo "No $DAEMON_NAME configuration file" >&2
     exit 1
 fi
 
@@ -62,7 +58,7 @@
             # Interface is in hotplug allowed list
             case "$ACTION" in
             add|register)
-                debug_mesg Invoking $DAEMON_NAME for $INTERFACE
+                logger -t ifplugd -p daemon.debug "Invoking $DAEMON_NAME for 
$INTERFACE"
 
                 # check for interface specific arguments
                 IF1=$(echo $INTERFACE | sed "s/-/_/")
@@ -77,7 +73,7 @@
                 exec $DAEMON -i $INTERFACE $A
                 ;;
             remove|unregister)
-                debug_mesg Stopping $DAEMON_NAME for $INTERFACE
+                logger -t ifplugd -p daemon.debug "Stopping $DAEMON_NAME for 
$INTERFACE"
 
                 # kill a running ifplugd daemon
                 exec $DAEMON -k -i $INTERFACE

Attachment: signature.asc
Description: PGP signature

Reply via email to