FCE_EV_SCRIPT(8)

πŸ“¦ version 4.6.1, in nixpkgs unstable

πŸ’… FCE_EV_SCRIPT(8) β€” the Netatalk AFP Fileserver Manual, bestie edition πŸŽ€

okay so first things first: this is fce_ev_script, from the Netatalk AFP Fileserver Manual, section 8. She's a little helper script and honestly she's carrying the whole notification department. Let's get into it ✨


🌸 NAME 🌸

fce_ev_script β€” the Netatalk Filesystem Change Events notification helper. that's her. that's the whole job. she notifies. she slays. periodt πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

fce_ev_script [-h] [-v version] [-e event] [-i id] [-P path] [-S source]
[-p pid] [-u user]

like, she takes a bunch of flags and she does the thing. no cap 🫢


πŸ’– DESCRIPTION πŸ’–

fce_ev_script is a notification helper for Netatalk's Filesystem Change Event (FCE) mechanism. she's literally designed to be plugged into the fce notify script option over in afp.conf. match made in heaven tbh πŸ₯°

so here's the lore: when afpd emits an FCE event and fce notify script is configured, afpd runs the configured script in the background and hands it all the event details as command-line options. passing notes in class, but make it infrastructure πŸ“

by default, fce_ev_script writes events to syslog with the tag netatalk-fce. but if the NETATALK_FCE_LOG_FILE environment variable is set, events get appended to that file instead. choose your own adventure, bestie ✨

Note: this utility requires netatalk to be built with FCE support enabled β€” that's the -Dwith-fce=true meson build option, which is enabled by default. so like, unless someone went out of their way to turn it off, you're good πŸ’€

✨ OPTIONS ✨

  • -h β€” show help text and exit. the "hey what does this do" button πŸŽ€
  • -v version β€” FCE script argument version.
  • -e event β€” FCE event name, such as FCE_FILE_CREATE. yes it's giving very specific πŸ“‹
  • -i id β€” FCE event id.
  • -P path β€” event path.
  • -S source β€” source path for move or rename events. the "where did it come from" of it all πŸ¦‹
  • -p pid β€” process id of the afpd process that emitted the event.
  • -u user β€” AFP session user that emitted the event. hi bestie who did this πŸ‘‘πŸ«Ά

πŸ’œ ENVIRONMENT πŸ’œ

  • NETATALK_FCE_LOG_FILE β€” append event lines to this file instead of syslog. important: the file must be writable by the AFP session users that may trigger events. so like, permissions check first, queen πŸ”
  • NETATALK_FCE_LOGGER β€” logger command to use when NETATALK_FCE_LOG_FILE is not set. default: logger.
  • NETATALK_FCE_LOG_TAG β€” syslog tag to use when NETATALK_FCE_LOG_FILE is not set. default: netatalk-fce.

🌈 EXECUTION CONTEXT 🌈

this part is lowkey the most important part so pay attention bestie 😭

afpd executes the configured notification script as the AFP session user β€” not necessarily as root, and not necessarily as the user that started Netatalk. it's giving "identity crisis" but it's actually just how it works πŸ’€

so: the configured script path must be executable by that user, and every parent directory in the path must be searchable by that user. every. single. one. no skipping levels πŸ™ˆ

and if file logging is enabled with NETATALK_FCE_LOG_FILE, that log file must also be writable by that user. no exceptions, no vibes-based permissions, fr fr 🫢


⭐ EXAMPLES ⭐

πŸŽ€ configure afpd to run the installed helper for each FCE event

[Global]
fce notify script = /usr/local/libexec/netatalk/fce_ev_script
fce version = 2
fce events = fmod,fdel,ddel,fcre,dcre,fmov,dmov,login,logout

a whole little event guest list and everyone's invited πŸ”₯

replace /usr/local/libexec with the libexec directory configured for your installation. iykyk β€” yours might not live there and that's fine πŸ’…

πŸŽ€ for diagnostic file logging, wrap the helper and set NETATALK_FCE_LOG_FILE

#!/bin/sh
NETATALK_FCE_LOG_FILE=/tmp/fce.log
export NETATALK_FCE_LOG_FILE
exec /usr/local/libexec/netatalk/fce_ev_script "$@"

the exec and the "$@" are doing the lord's work here β€” copy them exactly, bestie, don't get creative 🧚


πŸ”₯ SEE ALSO πŸ”₯

afpd(8), afp.conf(5), fce_listen(1) β€” go read your friends too, they're all iconic πŸ‘‘


and that's the page!! she's fce_ev_script from the Netatalk 4.6.1 era, and this whole manual page said what it said πŸ’– go forth and notify, bestie πŸ’œπŸ¦‹βœ¨

πŸ“¦ where this page comes from