STAFD(8)

πŸ’– STAFD(8) β€” the STorage Appliance Finder, bestie edition πŸ’–

okay so you opened the manual for stafd and honestly? slay. this is the STorage Appliance Finder, a whole system daemon, and she is that girl. let's get into it 🫢

✨ SYNOPSIS ✨

stafd [OPTIONS...]

that's it. that's the whole vibe. just stafd and whatever options your heart desires πŸ’…

🌸 DESCRIPTION 🌸

so here's the tea, bestie: stafd is a system daemon that can automatically find and connect to NVMe-oF Discovery Controllers using mDNS service discovery. she literally just sniffs them out. no cap. πŸ”₯

and also? if mDNS can't find a Discovery Controller for whatever reason, you can hand-configure her using stafd.conf(5) to connect to the ones that mDNS just couldn't locate. she's flexible like that. main character energy fr fr ✨

πŸ‘‘ OPTIONS πŸ‘‘

here's everything she understands, no skips, every single one:

  • -h, --help β€” prints the help text and dips. that's it, that's the whole job πŸŽ€
  • --version β€” prints the version string and exits. show-off behavior, love that for her πŸ’…
  • -fFILE, --conf-file=FILE β€” point her at a different configuration file than stafd.conf(5). the default is /etc/stas/stafd.conf btw, in case you were wondering πŸ¦‹
  • -s, --syslog β€” send messages to syslog instead of stdout. use this when you're running stafd as a daemon. (default: false). yes queen, log responsibly πŸ’–
  • --tron β€” Trace ON. (default: false). it's giving tracing. it's giving debug. we love a mysterious little flag ⭐
  • --idl=FILE β€” print the D-Bus IDL to FILE and exit. fancy ✨

πŸ’€ EXIT STATUS πŸ’€

on success, 0 is returned. anything else and you get a non-zero failure code. periodt.

🧚 DAEMONIZATION 🧚

stafd is managed by systemd, and the following operations are supported (the original had a whole cute table but we're doing bullets because we're chill like that):

  • $ systemctl start stafd β€” start daemon. go bestie go πŸƒβ™€οΈ
  • $ systemctl stop stafd β€” stop daemon. the SIGTERM signal is used to tell the daemon to stop. she hears you, she's leaving 😭
  • $ systemctl restart stafd β€” effectively a stop + start. the classic one-two 🌈
  • $ systemctl reload stafd β€” reload configuration. this is done in real time without restarting the daemon. the SIGHUP signal is used to tell the daemon to reload its configuration file.
⚠️ important caveat bestie: configuration parameters that affect connections (e.g. kato) will not apply to existing connections. only connections established after the configuration was changed will utilize the new configuration parameters. so don't come for her when your old connections are still on the old settings, ok? she warned you πŸ’…

🌈 DESIGN 🌈

stafd uses the GLib main loop. the GLib Python module provides several low-level building blocks that stafd requires. and in addition, many Python modules "play nice" with GLib such as dasbus (D-Bus package) and pyudev (UDev package). GLib also provides additional components such as timers, signal handlers, and much more. the ecosystem is thriving, honestly 🌸

stafd connects to the avahi-daemon using D-Bus. the avahi-daemon, or simply Avahi, is an mDNS discovery service used for zero-configuration networking (zeroconf). stafd registers with Avahi to automatically locate Central Discovery Controllers (CDC) and Direct Discovery Controllers (DDC). when Avahi finds Discovery Controllers (DC), it notifies stafd, which connects to the DC with the help of the libnvme library. once a connection to a DC is established, stafd can retrieve the discovery log pages from that DC and cache them in memory. iconic behavior, no notes πŸ”₯

πŸŽ€ CONFIGURATION πŸŽ€

stafd can automatically locate discovery controllers (DC) with the help of Avahi and connect to them. however, stafd can also operate in a non-automatic mode based on manually entered configuration. in other words? DCs can be entered in a configuration named /etc/stas/stafd.conf. this configuration file also provides additional parameters, such as log-level attributes used for debugging purposes. so yes, you can hand-hold her. she doesn't mind 🫢

πŸ’œ D-BUS API πŸ’œ

the interface to stafd is D-Bus. this allows other programs, such as stafctl, to communicate with stafd. the D-Bus address is org.nvmexpress.staf. she's social, ok?? she talks to everybody 😭✨

πŸ” SEE ALSO πŸ”

go read those too, bestie. iykyk πŸ“š


okay and finally, the cute little sign-off: this whole thing is from nvme-stas 2.4.1, and it's the STAFD(8) page. thanks for coming to my TED talk, mwah πŸ’‹πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from