[icinga-checkins] icinga.org: icinga-web/jmosshammer/default: Scheduler Install routine in MAKE

git at icinga.org git at icinga.org
Wed Apr 14 16:50:12 CEST 2010


Module: icinga-web
Branch: jmosshammer/default
Commit: 7814664d4bbaaf90814aca79d5a3a92ffff7633b
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=7814664d4bbaaf90814aca79d5a3a92ffff7633b

Author: jmosshammer <jannis.mosshammer at netways.de>
Date:   Wed Apr 14 16:46:44 2010 +0200

Scheduler Install routine in MAKE

---

 Makefile.in              |    8 ++++++++
 etc/build.xml            |   18 +++++++++++++++++-
 etc/scheduler/icingaCron |    5 +++++
 3 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index c601e07..72d7bb8 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -45,6 +45,9 @@ none:
 	@$(PRINTF) "\t%18s - %s\n" "loc-create-mo" "Compile all po files"
 	@$(PRINTF) "\t%18s - %s\n" "loc-create-json" "Create json gettext from po"
 
+	@$(PRINTF) "\nScheduler targets:\n"
+	@$(PRINTF) "\t%18s - %s\n" "scheduler-install" "Install the icingaScheduler cronkjob"
+	@$(PRINTF) "\t%18s - %s\n" "scheduler-remove" "remove the icingaScheduler cronkjob"
 	@$(PRINTF) "\n\n"
 	
 include $(INC_MAKE_FILES)
@@ -122,3 +125,8 @@ loc-create-mo:
 loc-create-json:
 	./bin/loc-create-json.sh res/i18n/po res/i18n/mo
 
+scheduler-install:
+	$(PC) scheduler-install -DPATH_Icinga=$(prefix)
+
+scheduler-remove:
+	$(PC) scheduler-remove -DPATH_Icinga=$(prefix)
diff --git a/etc/build.xml b/etc/build.xml
index b670b03..b51c3d6 100755
--- a/etc/build.xml
+++ b/etc/build.xml
@@ -153,6 +153,22 @@
 			passthru="true" 
 			checkreturn="true" />
 	</target>
+	<target name="scheduler-install">
+		<input propertyname="USER_Icinga" promptChar="?" defaultValue="icinga">Name of icinga-user</input>
 
+		<copy file="etc/scheduler/icingaCron" tofile="/etc/cron.d/icingaCron">
+			<filterchain>
+				<replacetokens begintoken="%%" endtoken="%%">
+					<token key="USER" value="${USER_Icinga}" />
+					<token key="PATH" value="${PATH_Icinga}" />				
+				</replacetokens>
+			</filterchain>
+		</copy>
+		<mkdir dir="/var/log/icingaCron" />
+		<chown file="/var/log/icingaCron" user="${USER_Icinga}" />
+	</target>
 	
-</project>
\ No newline at end of file
+	<target name="scheduler-remove">
+		<delete file="/etc/cron.d/icingaCron"/>
+	</target>
+</project>
diff --git a/etc/scheduler/icingaCron b/etc/scheduler/icingaCron
new file mode 100644
index 0000000..8e4365f
--- /dev/null
+++ b/etc/scheduler/icingaCron
@@ -0,0 +1,5 @@
+# Icinga Cron entry
+#
+# Simply executes the scheduler every minute
+
+*/1 *	* * *	%%USER%% /usr/bin/php %%PATH%%/lib/icingaScheduler/icingaCron.php --useAgavi --exec >> /var/log/icingaCron/error.log





More information about the icinga-checkins mailing list