NETWORKD-DISPATCHER(8)
๐ NAME ๐
Okay bestie, this is the NETWORKD-DISPATCHER(8) manual page ๐ and it's about networkd-dispatcher, a dispatcher service for systemd-networkd connection status changes ๐ธ
โจ SYNOPSIS โจ
networkd-dispatcher [-h] [-S SCRIPT_DIR] [-T] [-v] [-q]
๐ฆ DESCRIPTION ๐ฆ
So okay, this is a dispatcher daemon for systemd-networkd connection status changes ๐
It's basically the cousin of NetworkManager-dispatcher, but way more chill, because it only handles the events that systemd-networkd(8) actually gives it ๐
The actions you want (scripts) live in directories that match the systemd-networkd operational states, all under SCRIPT_DIR. When the daemon gets the matching event from systemd-networkd, it runs them โจ
It listens for signals from systemd-networkd over dbus, so it's super light on resources (no polling, no drama) ๐ซถ It's meant to run as a system-wide daemon, as root. That's what makes it perfect for stuff like starting a VPN once a connection is up ๐ฅ
๐ OPTIONS ๐
-h,--helpโ Prints the command-line syntax and program options to stdout ๐-S,--script-dir=SCRIPT_DIRโ This is where it looks for scripts ๐ง Like thePATHenvironment variable, you can list several directories separated by:. If more than one directory has a script with the same name, the earliest directory wins. It defaults to/etc/networkd-dispatcher:/usr/lib/networkd-dispatcher-T,--run-startup-triggersโ Generates events that reflect the state and behavior that already exist when it starts up ๐ This is clutch ifnetworkd-dispatchergets launched aftersystemd-networkdhas already started an interface, because the triggers still get belatedly run-v,--verboseโ Bumps verbosity up by one level ๐ The default level isWARNING. Each-vmoves the log level towardINFOorDEBUG-q,--quietโ Turns verbosity down by one level ๐คซ Each-qmoves the log level towardERRORorCRITICAL
๐ CONFIGURATION FILES ๐
The systemd service reads /etc/default/networkd-dispatcher as an environment file for extra daemon arguments ๐
The scripts that run on network changes go into these subdirectories inside SCRIPT_DIR: routable.d/, dormant.d/, no-carrier.d/, off.d/, carrier.d/, degraded.d/, configured.d/, and configuring.d/. The default SCRIPT_DIR is /etc/networkd-dispatcher:/usr/lib/networkd-dispatcher ๐
For info on the network operational states systemd exposes, check out networkctl(1) ๐ธ
๐ ENVIRONMENT ๐
Scripts run with some environment variables already set ๐ Some of them might be unset or empty, depending on the type of event. Scripts can use these to do stuff conditionally, like acting on a specific interface or state โจ
IFACEโ the interface that triggered the event ๐ฆSTATEโ the destination state change that the script is currently being invoked for ๐ It can be any value listed as valid forAdministrativeStateorOperationalStateESSIDโ for wlan connections, the ESSID the device is connected to ๐ถADDRโ the ipv4 address of the device ๐IP_ADDRSโ a space-delimited string of the ipv4 address(es) assigned to the device (see note below) ๐ซงIP6_ADDRSโ a space-delimited string of the ipv6 address(es) assigned to the device (see note below) ๐ซงAdministrativeStateโ one ofpending,configuring,configured,unmanaged,failedorlinger๐OperationalStateโ one ofoff,no-carrier,dormant,carrier,degraded,routable,configuring, orconfigured๐ฅ For more info on these states, see the networkctl manpage (man networkctl)
๐ RESOURCES ๐
GitLab: https://gitlab.com/craftyguy/networkd-dispatcher ๐งก
๐ SEE ALSO ๐
systemd-networkd(8), networkctl(1) ๐ซถ
That's the whole NETWORKD-DISPATCHER(8) page, bestie ๐ Last updated 07/11/2024, so it's giving fresh โจ๐
๐ฆ where this page comes from
- debian trixie: networkd-dispatcher 2.2.4-1.1 ยท GPL-3.0-or-later
- ubuntu questing: networkd-dispatcher 2.2.4-1.1 ยท GPL-3.0-or-later
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms