1NETPLUGD(8) BSD System Manager's Manual NETPLUGD(8)
2
4 netplugd — network cable hotplug management daemon
5
7 netplugd [-FP] [-c config_file] [-i interface_pattern] [-p pid_file]
8
10 netplugd is a daemon that responds to network link events from the Linux
11 kernel, such as a network interface losing or acquiring a carrier signal.
12
13 When an Ethernet-style network interface on a host is plugged into a pow‐
14 ered-up switch, hub, or other host, the two use a carrier signal to
15 establish that the link is alive. The Linux kernel makes this informa‐
16 tion available through its netlink(7) interface.
17
18 The netplugd daemon listens for carrier detection and loss messages from
19 the kernel's netlink(7) subsystem. When a carrier signal is detected on
20 an interface, it runs a script to bring the interface up. When carrier
21 is lost, netplugd runs a script to bring the interface down. netplugd
22 does not define any policies for how to manage interfaces; it leaves that
23 to a script, /etc/netplug.d/netplug, which is described in FILES below.
24
25 You tell netplugd which interfaces it should manage by giving it a list
26 of shell-style glob patterns, which it matches against using the
27 fnmatch(3) function. For example, a pattern of eth[13] will tell
28 netplugd to only manage eth1 and eth3, if those interfaces exist. If the
29 interfaces are not known to the kernel at the time you start netplugd,
30 perhaps because they are unplugged PCMCIA network interfaces or devices
31 whose drivers have not yet been installed, netplugd will start to manage
32 them as soon as they are plugged in or their drivers are available.
33
35 -F Run in the foreground; do not detach and run as a daemon. Mes‐
36 sages are logged to stdout or stderr, instead of using the
37 syslog(3) mechanism. This option is useful mainly for debugging
38 your configuration.
39
40 -P Prevent autoprobing for interfaces. The netplugd daemon normally
41 probes for all possible interface names that might match the pat‐
42 terns you tell it to manage. This is necessary in order to get
43 network driver modules (the default with almost all Linux distri‐
44 butions) loaded and set up, so that they can provide link status
45 notifications to the netplugd daemon. Autoprobing should always
46 be safe, and doesn't take long. Disable it with caution.
47
48 -c config_file
49 Specify the name of a file from which to read patterns that
50 describe the interfaces to manage. You can provide this option
51 multiple times to read from more than one file. If you do not
52 provide this option at all, netplugd will attempt to read from a
53 default config file. If you do not want netplugd to try to read
54 from any real config files, you can specify /dev/null as a config
55 file.
56
57 -i interface_pattern
58 Specify a pattern that will be used to match interface names that
59 netplugd should manage. You can provide this option multiple
60 times to specify multiple patterns.
61
62 -p pid_file
63 Write the daemon's process ID to the file pid_file. If you tell
64 netplugd to run in the foreground, this option is ignored.
65
67 /etc/netplug/netplugd.conf
68 Default config file to read, if none is specified on the command
69 line. The config file format is one pattern per line, with white
70 space, empty lines, and comments starting with a # character
71 ignored. Patterns are standard shell-style glob patterns, e.g.
72 "eth[0-9]".
73
74 /etc/netplug.d/netplug
75 The "policy" program (typically a shell script) that netplugd
76 uses to probe for interfaces, and to bring them up or down in
77 response to network link events. This program is called with the
78 name of the interface as its first argument, and one of the fol‐
79 lowing options:
80
81 in A cable was plugged in, or carrier came up. The command
82 should bring the interface up. The command is run asyn‐
83 chronously, and it should exit with status 0 on success.
84
85 out A cable was plugged out, or carrier went down. The com‐
86 mand should bring the interface down. The command is run
87 asynchronously, and it should exit with status 0 on suc‐
88 cess.
89
90 probe The command should load and initialise the driver for
91 this interface, if possible, and bring the interface into
92 the "up" state, so that it can generate netlink(7)
93 events. The command is run synchronously; it must exit
94 with status code 0 if it succeeds, otherwise with a non-
95 zero exit code or signal.
96
97 /etc/rc.d/init.d/netplugd
98 The init(8) script that starts, stops, and displays status of the
99 netplugd daemon.
100
102 netplugd was written by Bryan O'Sullivan <bos@serpentine.com>.
103
105 Copyright 2003 PathScale, Inc. Copyright 2003, 2004, 2005 Bryan O'Sulli‐
106 van
107
108 netplugd is free software; you can redistribute it and/or modify it under
109 the terms of the GNU General Public License, version 2, as published by
110 the Free Software Foundation. You are forbidden from redistributing or
111 modifying it under the terms of any other license, including other ver‐
112 sions of the GNU General Public License.
113
114 netplugd is distributed in the hope that it will be useful, but WITHOUT
115 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
116 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
117 more details.
118
120 cardmgr(5), hotplug(8), ip(8), netlink(7)
121
122Linux 2.6 August 26, 2003 Linux 2.6