RC_CONFIG(3)
π RC_CONFIG(3) β the OpenRC config-querying girlies π
okay so bestie, welcome to the Run Command library β that's librc, and you link it with -lrc. This page is all about the little functions that let you peek at OpenRC service config files without losing your mind. Let's get into it β¨
β¨ NAME β¨
rc_config_list, rc_config_load, rc_config_value, rc_yesno β the functions that query OpenRC service configurations. That's the whole squad π«Ά
β¨ SYNOPSIS β¨
#include <rc.h>
RC_STRINGLIST *
rc_config_list(const char *file);
RC_STRINGLIST *
rc_config_load(const char *file);
char *
rc_config_value(const char *const *list, const char *entry);
bool
rc_yesno(const char *value);
like, look at them. iconic signatures. no notes π
β¨ DESCRIPTION β¨
These functions are your easy lil shortcut to querying OpenRC configuration files, fr fr. No cap, they make it so much easier than doing it all by hand.
rc_config_list()β returns a list of the non-comment lines in file. Just the good stuff, no#-noise πΈrc_config_load()β does the exact same thing, but it also attempts to parse the line as if it was a shell assignment. highkey the glow-up version β¨rc_config_value()β returns the value of entry found in list. like, you give it the list, you give it the key, it gives you the value. slay π₯
bestie listen β each list should be freed using rc_stringlist_free() when you're done with it. don't be out here leaking memory, that's not the vibe π
rc_yesno()β returnstrueif value is"true","yes","y"or"1", regardless of case. Otherwise, if value is"false","no","n"or"0"(regardless of case), it returnsfalse. And if value doesn't match either one? Then it returnsfalseand setserrnotoEINVAL. so yeah, it's giving "no means no, but also invalid means no" π
β¨ SEE ALSO β¨
malloc(3), rc_stringlist_free(3), sh(1) β go read those too, iykyk π¦
β¨ AUTHORS β¨
Roy Marples <roy@marples.name> β the main character who made this happen π
and that's the page bestie!! this one's from the OpenRC manual, dated Mar 17, 2008. periodt. πβ¨π
π¦ 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
- Copyright (c) 2007-2015 The OpenRC Authors
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms