S6-GETSERVBYNAME(8)

πŸ“¦ version 2.8.0.1, in nixpkgs unstable

✨ S6-GETSERVBYNAME(8) ✨

okay so bestie, welcome to s6-getservbyname β€” it's a little command-line bestie for the getservbyname(3) function, and honestly? it's giving service name + protocol β†’ port number conversion and it does it flawlessly. this lives in the System Manager's Manual, section 8, iykyk πŸ’…


πŸ’– NAME πŸ’–

s6-getservbyname β€” a simple command-line interface to the getservbyname(3) function, converting a service name and protocol into a port number. that's it, that's the whole vibe πŸŽ€


🌸 SYNOPSIS 🌸

s6-getservbyname name proto

like. two args. that's the whole thing. iconic behavior honestly ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so what it does is: s6-getservbyname looks up the network services database for an entry containing name name and protocol proto. lowkey search-and-rescue but for services πŸ”

once it finds it, it prints the corresponding port number to stdout, then exits 0. slay. perfect. no notes 🫢

and if it cannot find a related entry? it exits 1. that's the whole failure mode, bestie β€” no drama, no crash, just a very dignified 1 😭


🧚 EXAMPLES 🧚

on a standard machine with a correct /etc/services file and a non-garbled NSS configuration (fr fr, those matter):

s6-getservbyname smtp tcp

prints 25.

that's it. that's the example. she ate and left no crumbs πŸ‘‘


🌈 SEE ALSO 🌈

this man page is ported from the authoritative documentation at: https://skarnet.org/software/s6-networking/s6-getservbyname.html

go read the source bestie, it's highkey worth it πŸ’œ


πŸ‘‘ AUTHORS πŸ‘‘

  • Laurent Bercot
  • Alexis <flexibeast@gmail.com> (man page port)

mwah πŸ’‹ this lil page is brought to you by Debian, dated September 29, 2021, and it goes by S6-GETSERVBYNAME(8) in the System Manager's Manual β€” periodt, that's the sign-off, love u bye πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from