RC_PLUGIN_HOOK(3)

πŸ’– RC_PLUGIN_HOOK πŸ’–

okay bestie, gather round, because this is the rc_plugin_hook page from the System Manager's Manual and it's literally the plug-in pipeline for OpenRC 🫢


✨ NAME ✨

rc_plugin_hook β€” hooks plugins into OpenRC services πŸ”Œ

like, it's the little function that lets your plugins get all up in OpenRC's business. no cap.


πŸ“š LIBRARY πŸ“š

Run Command library (librc, -lrc)

yep, that's the one you link against. <mint>-lrc</mint> and you're in. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <rc.h>

int
rc_plugin_hook(RC_HOOK hook, const char *name);

look at her. two args, returns an int. clean. iconic. periodt. ⭐


🌸 DESCRIPTION 🌸

so here's the tea, bestie: rc_plugin_hook() gets called for each shareable object found in /lib/rc/plugins. that's the whole vibe β€” every single one, one at a time, no skipping. πŸ”₯

  • hook is set to the hook running β€” like, which moment in the lifecycle we're at rn.
  • name is set to the name of the runlevel, or the name of the service. depends on what's happening, iykyk.

and here's the part that's giving main character energy: plugins can affect the parent environment by writing NULL separated strings to rc_environ_fd. πŸ’«

fr fr, NULL separated. not newline separated, not space separated. NULL. separated. get it wrong and the parent env will simply not understand you. πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

go read those too, bestie, they're the rest of the lore 🌈


πŸ’œ AUTHORS πŸ’œ

Roy Marples <roy@marples.name> β€” the original legend, we stan πŸŽ€


and that's a wrap! this page came from OpenRC, dated Mar 16, 2008, and yeah it's an oldie but she ate and left no crumbs. go write some plugins, bestie πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from