From c57f2a756831077fa8d56edf21395df39c9d3a5b Mon Sep 17 00:00:00 2001 From: Dinko Korunic Date: Thu, 15 Aug 2013 18:56:59 +0200 Subject: [PATCH] * prilagodbe za Wheezy * dodan Zabbix-agent * /etc/monit.d je preseljen u /etc/monit/conf.d sa svim konfiguracijskim datotekama --- README.CARNet | 36 ++++++++++++++++++++++++------------ debian/changelog | 8 ++++++++ debian/compat | 2 +- debian/control | 6 +++--- debian/copyright | 2 +- debian/postinst | 28 +++++++++++++++++++++------- debian/postrm | 2 +- monit-cn/monitrc | 9 +++++++-- monit-cn/zabbix-agent.conf | 10 ++++++++++ update-monit.d | 4 ++-- 10 files changed, 78 insertions(+), 29 deletions(-) create mode 100644 monit-cn/zabbix-agent.conf diff --git a/README.CARNet b/README.CARNet index 3d7fd1f..2b0ffe6 100644 --- a/README.CARNet +++ b/README.CARNet @@ -17,17 +17,29 @@ monit servis ako je aktivan. Za sljedece servise dolaze gotovi predlosci: - amavisd.conf dsmc.conf ntp-server.conf saslauthd.conf - aosi.conf exim.conf ntp.conf sendmail.conf - apache1.conf freeradius.conf openldap.conf snmpd.conf - apache2.conf mailgraph.conf pdns-recursor.conf sophie.conf - asterisk.conf mailman.conf pdns.conf sshd.conf - bind8.conf maradns-zoneserver.conf postfix.conf syslogd.conf - bind9.conf maradns.conf postgrey.conf thttpd.conf - clamd.conf monitrc proftpd.conf tomcat5.conf - cron.conf mysqld.conf qpopper.conf vsftpd.conf - dhcpd3.conf nginx.conf rsyslogd.conf - dovecot.conf nsd3.conf samba.conf + amavisd.conf nsd3.conf + aosi.conf ntp.conf + aosi-old.conf ntp-server.conf + apache1.conf openldap.conf + apache2.conf pdns.conf + asterisk.conf pdns-recursor.conf + bind8.conf postfix.conf + bind9.conf postgrey.conf + bind9-lenny.conf proftpd.conf + bind9-lennyold.conf qpopper.conf + clamd.conf rsyslogd.conf + cron.conf samba.conf + dhcpd3.conf saslauthd.conf + dovecot.conf sendmail.conf + dsmc.conf snmpd.conf + exim.conf sophie.conf + freeradius.conf sshd.conf + mailgraph.conf syslogd.conf + mailman.conf thttpd.conf + maradns.conf tomcat5.conf + maradns-zoneserver.conf vsftpd.conf + mysqld.conf zabbix-agent.conf + nginx.conf Primijetite da je monit respawnable proces -- on ne starta kroz /etc/init.d/monit skripte (tzv. System V init skripte), vec kroz @@ -35,4 +47,4 @@ Primijetite da je monit respawnable proces -- on ne starta kroz "padne" ili ga nehotice netko "ubije", on ce se automatski odmah pokrenuti nazad. - -- Dinko Korunic Wed, 27 Apr 2011 18:45:06 +0200 + -- Dinko Korunic Thu, 15 Aug 2013 18:01:51 +0200 diff --git a/debian/changelog b/debian/changelog index 599ad47..c145cd0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +monit-cn (1:5.4.0) stable; urgency=low + + * prilagodbe za Wheezy + * dodan Zabbix-agent + * /etc/monit.d je preseljen u /etc/monit/conf.d sa svim konfiguracijskim datotekama + + -- Dinko Korunic Thu, 15 Aug 2013 18:34:42 +0200 + monit-cn (1:5.1.3) stable; urgency=low * novi Aosi template zbog promjena naziva init skripte diff --git a/debian/compat b/debian/compat index 7f8f011..ec63514 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -7 +9 diff --git a/debian/control b/debian/control index cf4a989..2cdc8f1 100644 --- a/debian/control +++ b/debian/control @@ -2,12 +2,12 @@ Source: monit-cn Section: net Priority: optional Maintainer: Dinko Korunic -Build-Depends: debhelper (>= 7) -Standards-Version: 3.9.1 +Build-Depends: debhelper (>= 9.20120909) +Standards-Version: 3.9.4 Package: monit-cn Architecture: all -Depends: monit (>= 1:5.1.1-1), carnet-tools-cn (>= 2.8.1), gawk | mawk, ${misc:Depends} +Depends: monit (>= 1:5.4-2), carnet-tools-cn (>= 3.0.4), gawk | mawk, ${misc:Depends} Description: A utility for monitoring and managing daemons or similar programs monit is a utility for monitoring and managing daemons or similar programs running on a Unix system. It will start specified programs diff --git a/debian/copyright b/debian/copyright index 46d11ef..1fb1065 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,6 +1,6 @@ Copyright: - Copyright (C) 2009 Dinko Korunic, CARNet, Grupa za izradu paketa + Copyright (C) 2013 Dinko Korunic, CARNet, Grupa za izradu paketa 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 diff --git a/debian/postinst b/debian/postinst index 25a4a2f..d503cf6 100755 --- a/debian/postinst +++ b/debian/postinst @@ -30,11 +30,10 @@ esac # import CN-functions . /usr/share/carnet-tools/functions.sh -# check if monitrc is an empty template +# check if monitrc is ours installfile=1 if [ -e /etc/monit/monitrc ]; then - lines=$(grep -v '^#' /etc/monit/monitrc | wc -l) - if [ $lines -lt 4 ]; then + if ! grep -q "CARNet package monit-cn" /etc/monit/monitrc; then installfile=1 mv -f /etc/monit/monitrc /etc/monit/monitrc.dpkg-old else @@ -61,12 +60,20 @@ cp_check_and_sed '^set alert [^[:space:]]*@[^[:space:]]* ' \ 's/^set alert \([^[:space:]]*@[^[:space:]]*\) .*$/set alert \1 but not on { instance }/g' \ /etc/monit/monitrc || true +# migrate from old hierarchy +if [ -d /etc/monit.d ]; then + find /etc/monit.d -type f -print0 | xargs -0r -I% mv % /etc/monit/conf.d || true + rmdir /etc/monit.d >/dev/null 2>&1 || true +fi + # (re)generate monit.d files update-monit.d || true # disable monit startup cp_check_and_sed '^startup[[:space:]]*=[[:space:]]*1' \ 's/^startup[[:space:]]*=.*/startup=0/g' /etc/default/monit || true +cp_check_and_sed '^START[[:space:]]*=[[:space:]]*yes' \ + 's/^START[[:space:]]*=.*/START=no/g' /etc/default/monit || true # systemv part if ! grep -q 'CARNet package monit-cn' /etc/init.d/monit; then @@ -95,20 +102,27 @@ EOF fi fi +# if old inittab is referencing sbin, fix it +if grep -q '/usr/sbin/monit' /etc/inittab; then + cp_check_and_sed '/usr/sbin/monit' \ + 's:/usr/sbin/monit:/usr/bin/monit:g' \ + /etc/inittab || true +fi + # install as inittab service -if ! grep -q '/usr/sbin/monit' /etc/inittab; then +if ! grep -q '/usr/bin/monit' /etc/inittab; then echo "CN: Installing monit service in /etc/inittab" cp -a /etc/inittab /etc/inittab.$$ cp-update monit-cn /etc/inittab.$$ <