rc_runlevel - Man Page

RC runlevel functions

Library

Run Command library (librc, -lrc)

Synopsis

#include <rc.h>

char *
rc_runlevel_get(void);

bool
rc_runlevel_exists();

RC_STRINGLIST *
rc_runlevel_list(void);

bool
rc_runlevel_set(const char *runlevel);

bool
rc_runlevel_starting(void);

bool
rc_runlevel_stopping(void);

Description

These functions provide a means of querying OpenRC to find out which runlevel we are in and what services are in which runlevel.

Implementation Notes

Each function that returns char * returns a malloced NULL terminated string that should be freed when done.

Each function that returns RC_STRINGLIST * should by freed by calling rc_stringlist_free() when done.

Files

/etc/init.d/functions.sh is provided by OpenRC, which allows shell scripts to use the above functions. For historical reasons our verbose functions are prefixed with v instead of suffixed. So einfov becomes veinfo, einfovn becomes veinfon. Rinse and repeat for the other verbose functions.

See Also

malloc(3), free(3) rc_stringlist_free(3)

Authors

Roy Marples <roy@marples.name>

Info

March 16, 2008