The LiMaL runlevel library namespace. More...
Classes | |
class | LSBService |
LSB specific sevice class. More... | |
class | Service |
Generic service class. More... | |
Typedefs | |
typedef BLOCXX_NAMESPACE::Int32 | LSBExitCode |
LSB service action exit code type. | |
typedef BLOCXX_NAMESPACE::Map < BLOCXX_NAMESPACE::String, BLOCXX_NAMESPACE::String > | LSBInitInfo |
typedef char | Runlevel |
typedef BLOCXX_NAMESPACE::Array < Runlevel > | Runlevels |
typedef BLOCXX_NAMESPACE::Array < BLOCXX_NAMESPACE::String > | ServiceCmdArgs |
Shortcut for command argument array. | |
typedef BLOCXX_NAMESPACE::Map < BLOCXX_NAMESPACE::String, BLOCXX_NAMESPACE::String > | ServiceEnvVars |
Shortcut for environment variable map. | |
Functions | |
Runlevel | getDefaultRunlevel () |
Runlevel | getCurrentRunlevel () |
Runlevels | getEnabledRunlevels () |
bool | isRunlevelEnabled (Runlevel runlevel) |
bool | setDefaultRunlevel (Runlevel runlevel) |
bool | switchToRunlevel (Runlevel runlevel) |
BLOCXX_NAMESPACE::Array < BLOCXX_NAMESPACE::String > | getRunlevelServiceNames (Runlevel runlevel) |
BLOCXX_NAMESPACE::String | getServiceScriptDir () |
BLOCXX_NAMESPACE::Array < BLOCXX_NAMESPACE::String > | getInstalledServiceNames () |
Variables | |
Common-Codes | |
const LSBExitCode | LSB_RC_SUCCESS = 0 |
success | |
const LSBExitCode | LSB_RC_FAILURE = 1 |
generic or unspecified error | |
const LSBExitCode | LSB_RC_INVALID_ARGUMENT = 2 |
invalid or excess argument(s) | |
const LSBExitCode | LSB_RC_NOT_IMPLEMENTED = 3 |
unimplemented feature ("reload") | |
const LSBExitCode | LSB_RC_NOT_ALLOWED = 4 |
user had insufficient privilege | |
const LSBExitCode | LSB_RC_NOT_INSTALLED = 5 |
program is not installed | |
const LSBExitCode | LSB_RC_NOT_CONFIGURED = 6 |
program is not configured | |
const LSBExitCode | LSB_RC_NOT_RUNNING = 7 |
program is not running | |
Status-Codes | |
const LSBExitCode | LSB_ST_RUNNING = 0 |
program is running or service is OK | |
const LSBExitCode | LSB_ST_DEAD_PID_EXISTS = 1 |
program is dead and /var/run pid file exists | |
const LSBExitCode | LSB_ST_DEAD_LOCK_EXISTS = 2 |
program is dead and /var/lock lock file exists | |
const LSBExitCode | LSB_ST_NOT_RUNNING = 3 |
program is not running | |
const LSBExitCode | LSB_ST_UNKNOWN = 4 |
program or service status is unknown |
The LiMaL runlevel library namespace.
The limal::runlevel namespace is only a alias. The real namespace is defined in the file config.h file to a namespace with appended API version number.
typedef BLOCXX_NAMESPACE ::Int32 limal::runlevel::LSBExitCode |
LSB service action exit code type.
LSB defines following service action exit codes:
0
success1
generic or unspecified error2
invalid or excess argument(s)3
unimplemented feature (for example, "reload")4
user had insufficient privilege5
program is not installed6
program is not configured7
program is not running8
- 99
reserved for future LSB use100
- 149
reserved for distribution use150
- 199
reserved for application use200
- 254
reserved0
program is running or service is OK1
program is dead and /var/run pid file exists2
program is dead and /var/lock lock file exists3
program is not running4
program or service status is unknown5
- 99
reserved for future LSB use100
- 149
reserved for distribution use150
- 199
reserved for application use200
- 254
reservedtypedef BLOCXX_NAMESPACE ::Map< BLOCXX_NAMESPACE ::String, BLOCXX_NAMESPACE ::String> limal::runlevel::LSBInitInfo |
typedef char limal::runlevel::Runlevel |
Runlevel numbers are ascii charactes '0'
- '6'
, 'B'
and 'S'
.
Linux Standard Base Core Specification 3.0.1 defines the set of valid runlevels 0
- 6
, reflecting the most frequent existing practice:
0
System halt1
Single user mode2
Local multiuser without remote network3
Full multiuser with network4
Not used (reserved for local use)5
Full multiuser with network and X11 or equivalent6
System reboot (Do not use this as default runlevel!)See the inittab(5) and init(8) manual pages for more information.
The runlevel S
is not meant to be used directly. It indicates, that the system is entering single user mode.
The runlevel B
is a ondemand entry in the /etc/inittab and can be used to execute processes on demand without to change the runlevel.
On NOVELL / SUSE LINUX, services marked with runlevel B
in LSB INIT INFO tags will be executed at system boot.
The runlevels 7
- 9
and the ondemand entries A
and C
may be also valid, but usually unused.
typedef BLOCXX_NAMESPACE ::Array<Runlevel> limal::runlevel::Runlevels |
typedef BLOCXX_NAMESPACE ::Array< BLOCXX_NAMESPACE ::String> limal::runlevel::ServiceCmdArgs |
Shortcut for command argument array.
typedef BLOCXX_NAMESPACE ::Map< BLOCXX_NAMESPACE ::String, BLOCXX_NAMESPACE ::String> limal::runlevel::ServiceEnvVars |
Shortcut for environment variable map.
Runlevel limal::runlevel::getCurrentRunlevel | ( | ) |
Runlevel limal::runlevel::getDefaultRunlevel | ( | ) |
Runlevels limal::runlevel::getEnabledRunlevels | ( | ) |
BLOCXX_NAMESPACE ::Array< BLOCXX_NAMESPACE ::String> limal::runlevel::getInstalledServiceNames | ( | ) |
BLOCXX_NAMESPACE ::Array< BLOCXX_NAMESPACE ::String> limal::runlevel::getRunlevelServiceNames | ( | Runlevel | runlevel | ) |
BLOCXX_NAMESPACE ::String limal::runlevel::getServiceScriptDir | ( | ) |
bool limal::runlevel::isRunlevelEnabled | ( | Runlevel | runlevel | ) |
runlevel | The runlevel to check. |
bool limal::runlevel::setDefaultRunlevel | ( | Runlevel | runlevel | ) |
Set the default runlevel in /etc/inittab.
runlevel | The new runlevel to set. |
bool limal::runlevel::switchToRunlevel | ( | Runlevel | runlevel | ) |
Trigger a switch to the specified runlevel.
runlevel | The new runlevel to switch to. |
const LSBExitCode limal::runlevel::LSB_RC_FAILURE = 1 |
generic or unspecified error
invalid or excess argument(s)
user had insufficient privilege
program is not configured
unimplemented feature ("reload")
program is not installed
program is not running
const LSBExitCode limal::runlevel::LSB_RC_SUCCESS = 0 |
success
program is dead and /var/lock lock file exists
program is dead and /var/run pid file exists
program is not running
const LSBExitCode limal::runlevel::LSB_ST_RUNNING = 0 |
program is running or service is OK
const LSBExitCode limal::runlevel::LSB_ST_UNKNOWN = 4 |
program or service status is unknown