mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
parent
ed48934ed4
commit
9d8edd286f
@ -7,6 +7,7 @@
|
||||
#cmakedefine HAVE_VFORK
|
||||
|
||||
#define ICINGA_PREFIX "${CMAKE_INSTALL_PREFIX}"
|
||||
#define ICINGA_SYSCONFDIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}"
|
||||
#define ICINGA_LOCALSTATEDIR "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}"
|
||||
#define ICINGA_PKGDATADIR "${CMAKE_INSTALL_FULL_DATADIR}/icinga2"
|
||||
|
||||
|
@ -1,10 +1,11 @@
|
||||
## <a id="global-variables"> Global Variables
|
||||
## <a id="global-variables"></a> Global Variables
|
||||
|
||||
Icinga 2 provides a number of special global variables:
|
||||
|
||||
Variable |Description
|
||||
--------------------------|-------------------
|
||||
IcingaPrefixDir |**Read-only.** Contains the installation prefix that was specified with cmake -DCMAKE_INSTALL_PREFIX. Defaults to /usr/local
|
||||
IcingaSysconfDir |**Read-only.** Contains the path of the sysconf directory. Defaults to IcingaPrefixDir + "/etc".
|
||||
IcingaLocalStateDir |**Read-only.** Contains the path of the local state directory. Defaults to IcingaPrefixDir + "/var".
|
||||
IcingaPkgDataDir |**Read-only.** Contains the path of the package data directory. Defaults to IcingaPrefixDir + "/share/icinga2".
|
||||
IcingaStatePath |**Read-write.** Contains the path of the Icinga 2 state file. Defaults to IcingaLocalStateDir + "/lib/icinga2/icinga2.state".
|
||||
|
@ -198,6 +198,7 @@ int main(int argc, char **argv)
|
||||
Application::InstallExceptionHandlers();
|
||||
|
||||
Application::DeclarePrefixDir(ICINGA_PREFIX);
|
||||
Application::DeclareSysconfDir(ICINGA_SYSCONFDIR);
|
||||
Application::DeclareLocalStateDir(ICINGA_LOCALSTATEDIR);
|
||||
Application::DeclarePkgDataDir(ICINGA_PKGDATADIR);
|
||||
|
||||
|
@ -609,6 +609,26 @@ void Application::DeclarePrefixDir(const String& path)
|
||||
ScriptVariable::Declare("IcingaPrefixDir", path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrives the path of the sysconf dir.
|
||||
*
|
||||
* @returns The path.
|
||||
*/
|
||||
String Application::GetSysconfDir(void)
|
||||
{
|
||||
return ScriptVariable::Get("IcingaSysconfDir");
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the path of the sysconf dir.
|
||||
*
|
||||
* @param path The new path.
|
||||
*/
|
||||
void Application::DeclareSysconfDir(const String& path)
|
||||
{
|
||||
ScriptVariable::Declare("IcingaSysconfDir", path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the path for the local state dir.
|
||||
*
|
||||
|
@ -73,6 +73,9 @@ public:
|
||||
static String GetPrefixDir(void);
|
||||
static void DeclarePrefixDir(const String& path);
|
||||
|
||||
static String GetSysconfDir(void);
|
||||
static void DeclareSysconfDir(const String& path);
|
||||
|
||||
static String GetLocalStateDir(void);
|
||||
static void DeclareLocalStateDir(const String& path);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user