AFPD(8)

πŸ’– NAME πŸ’–

afpd β€” the Apple Filing Protocol daemon, aka the main character of your file server πŸ’…


✨ SYNOPSIS ✨

afpd [-d] [-F configfile]

afpd [-v | -V | -h]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so bestie, afpd is the whole vibe: it hands out an Apple Filing Protocol (AFP) interface to your plain old Unix file system 🌈. It's normally started up at boot time by netatalk(8), so you don't usually have to yell at it yourself.

And the config file that tells afpd how to behave and how your file server is set up? That's afp.conf, no cap πŸ“„βœ¨


πŸŽ€ OPTIONS πŸŽ€

  • -d β€” Do not disassociate the daemon from the terminal. It stays right there with you, holding your hand 🫢
  • -v β€” Print version information and dip. Bye πŸ‘‹
  • -V β€” Print verbose information and dip. Extra chatty edition πŸ’¬
  • -h β€” Print help and dip. Your lil cheat sheet 🧚
  • -F configfile β€” Specifies the configuration file to use. Pick your own adventure πŸ—ΊοΈ

πŸ’… SIGNALS πŸ’…

Real talk first: if you wanna shut down a user's afpd process, please do NOT use SIGKILL (-9) unless it's genuinely your absolute last resort 😭 that can leave the CNID database in an inconsistent state, and nobody wants that mess. The safe way is to send it a SIGTERM (-15) and just… wait for it to die on its own. Let it go gracefully, periodt ✨

Also important: SIGTERM and SIGUSR1 that get sent to the parent afpd process get propagated down to the children, so every process will be affected. Family meeting πŸ“£

  • SIGTERM β€” Clean exit. Propagates from parent to children. Respectful, tidy, iconic πŸŽ€
  • SIGQUIT β€” Sending this to the parent afpd will cause it to exit, but leaving all children running! Sounds chaotic but it's on purpose: you can use this to implement an AFP service without downtime πŸ”₯ (no downtime?? slay.)
  • SIGHUP β€” Sending a SIGHUP to afpd will cause it to reload its configuration files. Glow-up, but for configs πŸ¦‹
  • SIGINT β€” Sending a SIGINT to a child afpd enables max_debug logging and dumps caches to the system tmp directory:
    • Debug log: afpd.PID.XXXXXX
    • Directory cache: dircache.PID

Directory cache dump (see dircache mode in afp.conf(5)):

  • LRU mode: Single queue of cached entries
  • ARC mode: T1/T2 (cached), B1/B2 (ghost) lists, parameter p, statistics

Sending another SIGINT reverts to original log settings. Undo button fr πŸ™ˆ

  • SIGUSR1 β€” The afpd process will send the message β€œThe server is going down for maintenance.” to the client and shut itself down in 5 minutes ⏳. New connections are not allowed. If this is sent to a child afpd, the other children are not affected. However, the main process will still exit, disabling all new connections. Heads up bestie, that part matters πŸ‘€
  • SIGUSR2 β€” Send a server message to the AFP client of a child afpd process. When the signal is received, afpd looks in the message directory (default: LOCALSTATEDIR/netatalk/msg/; the compiled-in path is printed by afpd -V) for a message file in the following order:
    1. message.PID β€” a file whose name ends with the child process ID
    2. message β€” a fallback used when no PID-specific file is found

The contents of the file are read and forwarded to the connected AFP client as a server message. The file is deleted after it is read. This signal must only be sent to a child afpd process. The parent afpd does not install a SIGUSR2 handler, so sending it there will terminate the parent process and prevent new connections πŸ’€ (not the vibe. do not do this.)

Example usage:

# Find the child afpd PID for the connected user, then:
echo "Scheduled maintenance tonight at 22:00" \
    > LOCALSTATEDIR/netatalk/msg/message.PID
kill -USR2 PID

🌸 FILES 🌸

  • afp.conf β€” configuration file used by afpd πŸ“
  • extmap.conf β€” file name extension mapping πŸ—‚οΈ
  • afp_signature.conf β€” list of server signatures ✍️
  • afp_voluuid.conf β€” list of UUIDs for Time Machine volumes ⏰
  • LOCALSTATEDIR/netatalk/msg/message.PID, LOCALSTATEDIR/netatalk/msg/message β€” Server message files read on SIGUSR2. The PID-specific form (message.PID) targets a single connected client; the plain message form is a fallback when no PID-specific file exists. Both are deleted after being read. The compiled-in directory path is printed by afpd -V 🌈

πŸ‘‘ SEE ALSO πŸ‘‘

netatalk(8), hosts_access(5), afp.conf(5), afp_signature.conf(5), afp_voluuid.conf(5), extmap.conf(5), dbd(1)


🫢 AUTHOR 🫢

Contributors to the Netatalk Project (https://netatalk.io/contributors) β€” kings and queens, honestly πŸ‘‘


and that's the whole page bestie!! this is Netatalk 4.5.1, page AFPD(8) β€” go forth and server responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from