[icinga-checkins] icinga.org: icinga2/master: Fixed default paths for icinga2. state and icinga2.pid files.

git at icinga.org git at icinga.org
Mon Feb 4 09:48:44 CET 2013


Module: icinga2
Branch: master
Commit: 00fb17880c2eb221103bef7bd0631fbfdb26960d
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=00fb17880c2eb221103bef7bd0631fbfdb26960d

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Mon Feb  4 09:48:37 2013 +0100

Fixed default paths for icinga2.state and icinga2.pid files.

---

 lib/icinga/icingaapplication.cpp |    7 ++-----
 lib/icinga/icingaapplication.h   |    3 ---
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/lib/icinga/icingaapplication.cpp b/lib/icinga/icingaapplication.cpp
index 91a5869..fea0490 100644
--- a/lib/icinga/icingaapplication.cpp
+++ b/lib/icinga/icingaapplication.cpp
@@ -30,9 +30,6 @@ REGISTER_TYPE(IcingaApplication, NULL);
 #	define ICINGA_VERSION GIT_MESSAGE
 #endif /* _WIN32 */
 
-const String IcingaApplication::DefaultPidPath = "icinga2.pid";
-const String IcingaApplication::DefaultStatePath = "icinga2.state";
-
 IcingaApplication::IcingaApplication(const Dictionary::Ptr& serializedUpdate)
 	: Application(serializedUpdate)
 {
@@ -126,7 +123,7 @@ String IcingaApplication::GetPidPath(void) const
 	Value pidPath = Get("pid_path");
 
 	if (pidPath.IsEmpty())
-		pidPath = DefaultPidPath;
+		pidPath = Application::GetLocalStateDir() + "/run/icinga2.pid";
 
 	return pidPath;
 }
@@ -136,7 +133,7 @@ String IcingaApplication::GetStatePath(void) const
 	Value statePath = Get("state_path");
 
 	if (statePath.IsEmpty())
-		statePath = DefaultStatePath;
+		statePath = Application::GetLocalStateDir() + "/lib/icinga2.state";
 
 	return statePath;
 }
diff --git a/lib/icinga/icingaapplication.h b/lib/icinga/icingaapplication.h
index f17222a..3bf7a8a 100644
--- a/lib/icinga/icingaapplication.h
+++ b/lib/icinga/icingaapplication.h
@@ -51,9 +51,6 @@ public:
 
 	double GetStartTime(void) const;
 
-	static const String DefaultPidPath;
-	static const String DefaultStatePath;
-
 private:
 	shared_ptr<SSL_CTX> m_SSLContext;
 





More information about the icinga-checkins mailing list