[packages/monit-rc-apache] - 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:27:34 CEST 2012


commit 96ed6c3e82c46b3a2d74756f63323eab78eb778f
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon Sep 24 12:27:29 2012 +0300

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

 apache.cron          |  7 +++++++
 monit-rc-apache.spec | 12 ++++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/monit-rc-apache.spec b/monit-rc-apache.spec
index 7f50b0a..30e7e80 100644
--- a/monit-rc-apache.spec
+++ b/monit-rc-apache.spec
@@ -1,15 +1,17 @@
 Summary:	monitrc file for monitoring Apache web server
 Summary(pl.UTF-8):	Plik monitrc do monitorowania serwera WWW Apache
 Name:		monit-rc-apache
-Version:	1.1
-Release:	3
+Version:	1.2
+Release:	1
 License:	GPL
 Group:		Applications/System
 Source0:	apache.monitrc
+Source1:	apache.cron
 BuildRequires:	rpmbuild(macros) >= 1.268
 Requires(post,postun):	monit
 Requires:	apache-base >= 2.2.3-8
 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.
 
 %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/httpd.monitrc
+cp -p %{SOURCE0} $RPM_BUILD_ROOT%{_sysconfdir}/monit/httpd.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/apache.cron b/apache.cron
new file mode 100644
index 0000000..52ea238
--- /dev/null
+++ b/apache.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-apache.git/commitdiff/96ed6c3e82c46b3a2d74756f63323eab78eb778f



More information about the pld-cvs-commit mailing list