rc_deptree3
Rc dependency tree functions
Usage
#include <rc.h>
bool Fn rc_deptree_update void
bool Fn rc_deptree_update_needed void
RC_DEPTREE Fn rc_deptree_load void
RC_STRINGLIST * Fo rc_deptree_depend
const RC_DEPTREE *deptree const char *type const char *service);
bool Fo rc_deptree_depends
const RC_DEPTREE *deptree const char *const *types const char *const *services const char *runlevel int options);
RC_STRINGLIST * Fo rc_deptree_order
const RC_DEPTREE *deptree const char *runlevel int options);
void Fn rc_deptree_free RC_DEPTREE *deptree
Library
Run Command library (librc, -lrc)
Overview
These functions provide a means of querying the dependencies of OpenRC services.
rc_deptree_update() updates the service dependency tree, normally /run/openrc/deptree. rc_deptree_update_needed() checks to see if the dependency tree needs updated based on the mtime of it compared to /etc/init.d, /etc/conf.d, /usr/local/etc/init.d, /usr/local/etc/conf.d, /etc/rc.conf and any files specified by a service.
rc_deptree_load() loads the deptree and returns a pointer to it which needs to be freed by rc_deptree_free() when done.
rc_deptree_depend(), rc_deptree_depends() and rc_deptree_order() return a list of services from the deptree based on the type or types of dependency. options can be a bitmask of RC_DEP_TRACE and RC_DEP_STRICT. RC_DEP_TRACE follows each services dependencies right down to the first service needed and RC_DEP_STRICT only lists services actually needed or in the runlevel.
Implementation notes
Each function that returns RC_STRINGLIST * should be freed by calling rc_stringlist_free() when done.
Releases
6 releases since Debian 8 (Jessie); the text changed 3 times.