find: support -HLP
[oweals/busybox.git] / networking / ifplugd.c
index 421611aae5fe7cc9a57b4f25f782bdf9b3cce0ed..3cdc2c9d29e58b27bd79749b5ec3c3b9ac71da38 100644 (file)
@@ -11,7 +11,6 @@
 //usage:       "[OPTIONS]"
 //usage:#define ifplugd_full_usage "\n\n"
 //usage:       "Network interface plug detection daemon\n"
-//usage:     "\nOptions:"
 //usage:     "\n       -n              Don't daemonize"
 //usage:     "\n       -s              Don't log to syslog"
 //usage:     "\n       -i IFACE        Interface"
@@ -23,9 +22,9 @@
 //usage:     "\n       -r PROG         Script to run"
 //usage:     "\n       -x ARG          Extra argument for script"
 //usage:     "\n       -I              Don't exit on nonzero exit code from script"
-//usage:     "\n       -p              Don't run script on daemon startup"
-//usage:     "\n       -q              Don't run script on daemon quit"
-//usage:     "\n       -l              Run script on startup even if no cable is detected"
+//usage:     "\n       -p              Don't run \"up\" script on startup"
+//usage:     "\n       -q              Don't run \"down\" script on exit"
+//usage:     "\n       -l              Always run script on startup"
 //usage:     "\n       -t SECS         Poll time in seconds"
 //usage:     "\n       -u SECS         Delay before running script after link up"
 //usage:     "\n       -d SECS         Delay after link down"
@@ -38,7 +37,9 @@
 #include <linux/if.h>
 #include <linux/mii.h>
 #include <linux/ethtool.h>
-#include <net/ethernet.h>
+#ifdef HAVE_NET_ETHERNET_H
+# include <net/ethernet.h>
+#endif
 #include <linux/netlink.h>
 #include <linux/rtnetlink.h>
 #include <linux/sockios.h>
@@ -550,12 +551,13 @@ int ifplugd_main(int argc UNUSED_PARAM, char **argv)
        applet_name = xasprintf("ifplugd(%s)", G.iface);
 
 #if ENABLE_FEATURE_PIDFILE
-       pidfile_name = xasprintf(_PATH_VARRUN"ifplugd.%s.pid", G.iface);
+       pidfile_name = xasprintf(CONFIG_PID_FILE_PATH "/ifplugd.%s.pid", G.iface);
        pid_from_pidfile = read_pid(pidfile_name);
 
        if (opts & FLAG_KILL) {
                if (pid_from_pidfile > 0)
-                       kill(pid_from_pidfile, SIGQUIT);
+                       /* Upstream tool use SIGINT for -k */
+                       kill(pid_from_pidfile, SIGINT);
                return EXIT_SUCCESS;
        }