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. π₯
hookis set to the hook running β like, which moment in the lifecycle we're at rn.nameis 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
- alpine 3.22: openrc-doc 0.62.6-r0 Β· BSD-2-Clause
- alpine 3.23: openrc-doc 0.63-r1 Β· BSD-2-Clause
- alpine 3.24: openrc-doc 0.63.2-r0 Β· BSD-2-Clause
- debian bookworm: librc-dev 0.45.2-2+deb12u1 Β· BSD-2-clauses
- debian trixie: librc-dev 0.56-1 Β· BSD-2-clauses
- Copyright (c) 2007-2015 The OpenRC Authors
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms