[packages/monit-rc-apache1] - add sample cron job to add apache back to monitoring state in case it forgotten

glen glen at pld-linux.org
Mon Sep 24 11:33:28 CEST 2012


commit 6fdf79cc7020e0fb75ee5e921e186c92fcd57dfa
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon Sep 24 12:33:02 2012 +0300

    - add sample cron job to add apache back to monitoring state in case it forgotten

 apache1.cron          |  7 +++++++
 monit-rc-apache1.spec | 12 ++++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/monit-rc-apache1.spec b/monit-rc-apache1.spec
index f1dccb7..8f19a36 100644
--- a/monit-rc-apache1.spec
+++ b/monit-rc-apache1.spec
@@ -1,15 +1,17 @@
 Summary:	monitrc file for monitoring Apache 1.x web server
 Summary(pl.UTF-8):	Plik monitrc do monitorowania serwera WWW Apache 1.x
 Name:		monit-rc-apache1
-Version:	1.1
-Release:	2
+Version:	1.2
+Release:	1
 License:	GPL
 Group:		Applications/System
 Source0:	apache1.monitrc
+Source1:	apache1.cron
 BuildRequires:	rpmbuild(macros) >= 1.268
 Requires(post,postun):	monit
 Requires:	apache1-base >= 1.3.39-2
 Requires:	monit
+Suggests:	crondaemon
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -23,9 +25,10 @@ Plik monitrc do monitorowania serwera WWW Apache 1.x.
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_sysconfdir}/monit
+install -d $RPM_BUILD_ROOT{%{_sysconfdir}/monit,/etc/cron.d}
 
-install %{SOURCE0} $RPM_BUILD_ROOT%{_sysconfdir}/monit/apache.monitrc
+cp -p %{SOURCE0} $RPM_BUILD_ROOT%{_sysconfdir}/monit/apache.monitrc
+cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.d/%{name}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -46,3 +49,4 @@ fi
 %files
 %defattr(644,root,root,755)
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/monit/*.monitrc
+%config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
diff --git a/apache1.cron b/apache1.cron
new file mode 100644
index 0000000..52ea238
--- /dev/null
+++ b/apache1.cron
@@ -0,0 +1,7 @@
+MAILTO=root
+
+# try to monitor again Apache
+
+# needed in cases when restarts get timeout and later problem is fixed by
+# sysadmin. something needs to give a kick to get apache back to monitoring.
+#55 */3 * * * root /usr/sbin/monit monitor apache
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/monit-rc-apache1.git/commitdiff/6fdf79cc7020e0fb75ee5e921e186c92fcd57dfa



More information about the pld-cvs-commit mailing list