//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"
//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"
#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>
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;
}