mirror of https://github.com/Icinga/icinga2.git
commit
67b82a81c9
|
@ -115,10 +115,12 @@ static bool LoadConfigFiles(const String& appType, bool validateOnly)
|
|||
return true;
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
static void SigHupHandler(int)
|
||||
{
|
||||
Application::RequestRestart();
|
||||
}
|
||||
#endif /* _WIN32 */
|
||||
|
||||
static bool Daemonize(const String& stderrFile)
|
||||
{
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
******************************************************************************/
|
||||
|
||||
library "methods"
|
||||
|
||||
template CheckCommand "plugin-check-command" {
|
||||
methods = {
|
||||
execute = "PluginCheck"
|
||||
|
|
|
@ -20,3 +20,4 @@ add_subdirectory(config)
|
|||
add_subdirectory(icinga)
|
||||
add_subdirectory(db_ido)
|
||||
add_subdirectory(methods)
|
||||
add_subdirectory(hello)
|
||||
|
|
|
@ -159,6 +159,11 @@ void Application::RunEventLoop(void) const
|
|||
#endif /* _DEBUG */
|
||||
}
|
||||
|
||||
void Application::OnShutdown(void)
|
||||
{
|
||||
/* Nothing to do here. */
|
||||
}
|
||||
|
||||
/**
|
||||
* Watches for changes to the system time. Adjusts timers if necessary.
|
||||
*/
|
||||
|
|
|
@ -101,7 +101,7 @@ protected:
|
|||
|
||||
void RunEventLoop(void) const;
|
||||
|
||||
virtual void OnShutdown(void) = 0;
|
||||
virtual void OnShutdown(void);
|
||||
|
||||
private:
|
||||
static Application *m_Instance; /**< The application instance. */
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
# Icinga 2
|
||||
# Copyright (C) 2012-2013 Icinga Development Team (http://www.icinga.org/)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
mkclass_target(hello.ti hello.th)
|
||||
|
||||
mkembedconfig_target(hello-type.conf hello-type.cpp)
|
||||
|
||||
add_library(hello SHARED
|
||||
hello.cpp hello.th hello-type.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(hello ${Boost_LIBRARIES} base)
|
||||
|
||||
set_target_properties (
|
||||
hello PROPERTIES
|
||||
INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
|
||||
FOLDER Lib
|
||||
)
|
||||
|
||||
install(
|
||||
TARGETS hello
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
|
||||
)
|
||||
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
/******************************************************************************
|
||||
* Icinga 2 *
|
||||
* Copyright (C) 2012-2013 Icinga Development Team (http://www.icinga.org/) *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License *
|
||||
* as published by the Free Software Foundation; either version 2 *
|
||||
* of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software Foundation *
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
******************************************************************************/
|
||||
|
||||
type Hello {
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
/******************************************************************************
|
||||
* Icinga 2 *
|
||||
* Copyright (C) 2012-2013 Icinga Development Team (http://www.icinga.org/) *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License *
|
||||
* as published by the Free Software Foundation; either version 2 *
|
||||
* of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software Foundation *
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
******************************************************************************/
|
||||
|
||||
#include "hello/hello.h"
|
||||
#include "base/dynamictype.h"
|
||||
#include "base/logger_fwd.h"
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
REGISTER_TYPE(Hello);
|
||||
|
||||
/**
|
||||
* The entry point for the Hello application.
|
||||
*
|
||||
* @returns An exit status.
|
||||
*/
|
||||
int Hello::Main(void)
|
||||
{
|
||||
Log(LogInformation, "hello", "Hello World!");
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
/******************************************************************************
|
||||
* Icinga 2 *
|
||||
* Copyright (C) 2012-2013 Icinga Development Team (http://www.icinga.org/) *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License *
|
||||
* as published by the Free Software Foundation; either version 2 *
|
||||
* of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software Foundation *
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef HELLO_H
|
||||
#define HELLO_H
|
||||
|
||||
#include "hello/hello.th"
|
||||
|
||||
namespace icinga
|
||||
{
|
||||
|
||||
/**
|
||||
* The Hello application.
|
||||
*
|
||||
* @ingroup hello
|
||||
*/
|
||||
class Hello : public ReflectionObjectImpl<Hello>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(Hello);
|
||||
DECLARE_TYPENAME(Hello);
|
||||
|
||||
int Main(void);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* HELLO_H */
|
|
@ -0,0 +1,10 @@
|
|||
#include "base/application.h"
|
||||
|
||||
namespace icinga
|
||||
{
|
||||
|
||||
class Hello : Application
|
||||
{
|
||||
};
|
||||
|
||||
}
|
|
@ -38,8 +38,6 @@ INITIALIZE_ONCE(IcingaApplication, &IcingaApplication::StaticInitialize);
|
|||
|
||||
void IcingaApplication::StaticInitialize(void)
|
||||
{
|
||||
(void) Utility::LoadExtensionLibrary("methods");
|
||||
|
||||
ScriptVariable::Set("IcingaEnableNotifications", true);
|
||||
ScriptVariable::Set("IcingaEnableEventHandlers", true);
|
||||
ScriptVariable::Set("IcingaEnableFlapping", true);
|
||||
|
|
Loading…
Reference in New Issue