aboutsummaryrefslogtreecommitdiff
path: root/man/rc_runlevel.3
blob: 47c5d2125637be75258915879fab2ba1da65d978 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
.\" Copyright (c) 2007-2015 The OpenRC Authors.
.\" See the Authors file at the top-level directory of this distribution and
.\" https://github.com/OpenRC/openrc/blob/master/AUTHORS
.\"
.\" This file is part of OpenRC. It is subject to the license terms in
.\" the LICENSE file found in the top-level directory of this
.\" distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE
.\" This file may not be copied, modified, propagated, or distributed
.\"    except according to the terms contained in the LICENSE file.
.\"
.Dd Mar 16, 2008
.Dt RC_RUNLEVEL 3 SMM
.Os OpenRC
.Sh NAME
.Nm rc_runlevel_get , rc_runlevel_exists , rc_runlevel_list , rc_runlevel_set ,
.Nm rc_runlevel_starting , rc_runlevel_stopping
.Nd RC runlevel functions
.Sh LIBRARY
Run Command library (librc, -lrc)
.Sh SYNOPSIS
.In rc.h
.Ft "char *" Fn rc_runlevel_get void
.Ft bool Fn rc_runlevel_exists
.Ft "RC_STRINGLIST *" Fn rc_runlevel_list void
.Ft bool Fn rc_runlevel_set "const char *runlevel"
.Ft bool Fn rc_runlevel_starting void
.Ft bool Fn rc_runlevel_stopping void
.Sh DESCRIPTION
These functions provide a means of querying OpenRC to find out which runlevel
we are in and what services are in which runlevel.
.Sh IMPLEMENTATION NOTES
Each function that returns
.Fr "char *"
returns a malloced NULL terminated string that should be freed when done.
.Pp
Each function that returns
.Fr "RC_STRINGLIST *"
should by freed by calling
.Fn rc_stringlist_free
when done.
.Sh FILES
.Pa /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.
.Sh SEE ALSO
.Xr malloc 3 ,
.Xr free 3
.Xr rc_stringlist_free 3
.Sh AUTHORS
.An Roy Marples <roy@marples.name>