NETPLUGD(8)

πŸ“¦ version 1.2.9.2, in fedora 43, fedora 44

πŸ’– netplugd β€” the network cable hotplug management daemon πŸ’–

okay so bestie, welcome to the netplugd(8) manual, it's a System Manager's Manual situation and honestly? iconic. let's get into it.


✨ NAME ✨

netplugd β€” network cable hotplug management daemon


🌈 SYNOPSIS 🌈

netplugd [-FP] [-c config_file] [-i interface_pattern] [-p pid_file]

πŸ¦‹ DESCRIPTION πŸ¦‹

so netplugd is a daemon (yes, a daemon, very main character) that responds to network link events coming from the Linux kernel β€” like when a network interface loses or acquires a carrier signal. lowkey vital.

when an Ethernet-style network interface on a host gets plugged into a powered-up switch, hub, or another host, the two of them use a carrier signal to establish that the link is alive. the Linux kernel makes this info available through its netlink(7) interface. periodt.

the netplugd daemon listens for carrier detection and loss messages from the kernel's netlink(7) subsystem. when a carrier signal is detected on an interface, it runs a script to bring the interface up. when carrier is lost, netplugd runs a script to bring the interface down. netplugd does not define any policies for how to manage interfaces β€” it leaves that whole vibe to a script, /etc/netplugd/netplug, which is described in "FILES" below. πŸ’…

you tell netplugd which interfaces it should manage by giving it a list of shell-style glob patterns, which it matches against using the fnmatch(3) function. for example, a pattern of eth[13] will tell netplugd to only manage eth1 and eth3, if those interfaces exist. and if the interfaces aren't known to the kernel at the time you start netplugd β€” maybe because they're unplugged PCMCIA network interfaces, or devices whose drivers haven't been installed yet β€” netplugd will start to manage them as soon as they're plugged in or their drivers become available. no cap, it just waits. 🫢


πŸŽ€ OPTIONS πŸŽ€

  • -F β€” run in the foreground; do not detach and run as a daemon. messages are logged to stdout or stderr instead of using the syslog(3) mechanism. this option is useful mainly for debugging your configuration. πŸ›
  • -P β€” prevent autoprobing for interfaces. the netplugd daemon normally probes for all possible interface names that might match the patterns you tell it to manage. this is necessary in order to get network driver modules (the default with almost all Linux distributions) loaded and set up, so they can provide link status notifications to the netplugd daemon. autoprobing should always be safe, and doesn't take long. disable it with caution. ⚠️
  • -c config_file β€” specify the name of a file from which to read patterns that describe the interfaces to manage. you can provide this option multiple times to read from more than one file. if you don't provide this option at all, netplugd will attempt to read from a default config file. and if you do not want netplugd to try to read from any real config files, you can specify /dev/null as a config file. sneaky but valid. πŸ™ˆ
  • -i interface_pattern β€” specify a pattern that will be used to match interface names that netplugd should manage. you can provide this option multiple times to specify multiple patterns.
  • -p pid_file β€” write the daemon's process ID to the file pid_file. if you tell netplugd to run in the foreground, this option is ignored. πŸ’€

🌸 FILES 🌸

  • /etc/netplug.d/netplugd.conf β€” default config file to read, if none is specified on the command line. the config file format is one pattern per line, with white space, empty lines, and comments starting with a # character ignored. patterns are standard shell-style glob patterns, e.g. "eth[0-9]". ✨
  • /etc/netplug.d/netplug β€” the "policy" program (typically a shell script) that netplugd uses to probe for interfaces, and to bring them up or down in response to network link events. this program is called with the name of the interface as its first argument, and one of the following options:
    • in β€” a cable was plugged in, or carrier came up. the command should bring the interface up. the command is run asynchronously, and it should exit with status 0 on success. πŸ”Œ
    • out β€” a cable was plugged out, or carrier went down. the command should bring the interface down. the command is run asynchronously, and it should exit with status 0 on success. πŸͺ«
    • probe β€” the command should load and initialise the driver for this interface, if possible, and bring the interface into the "up" state, so that it can generate netlink(7) events. the command is run synchronously; it must exit with status code 0 if it succeeds, otherwise with a non-zero exit code or signal. πŸ”

πŸ‘‘ AUTHOR πŸ‘‘

netplugd was written by Bryan O'Sullivan <bos@serpentine.com>. king behavior honestly.


Copyright 2003 PathScale, Inc. Copyright 2003, 2004, 2005 Bryan O'Sullivan

netplugd is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation. you are forbidden from redistributing or modifying it under the terms of any other license, including other versions of the GNU General Public License. like, read that again bestie. 🚫

netplugd is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. see the GNU General Public License for more details.


⭐ SEE ALSO ⭐

cardmgr(5), hotplug(8), ip(8), netlink(7)


and that's the whole page, bestie β€” this one's from the Linux 2.6 era, dated August 26, 2003. old but still serving. πŸ’…βœ¨πŸ’–
πŸ“¦ where this page comes from