Za sljedece servise dolaze gotovi predlosci:
- amavisd.conf bind9.conf freeradius.conf proftpd.conf sshd.conf
- aosi.conf clamd.conf mysqld.conf qpopper.conf syslogd.conf
- apache1.conf cron.conf ntpd.conf samba.conf thttpd.conf
- apache2.conf dhcpd3.conf openldap.conf saslauthd.conf tomcat5.conf
- asterisk.conf dovecot.conf postfix.conf sendmail.conf vsftpd.conf
- bind8.conf exim.conf postgrey.conf sophie.conf
+ amavisd.conf bind9.conf freeradius.conf postgrey.conf sophie.conf
+ aosi.conf clamd.conf mailman.conf proftpd.conf sshd.conf
+ apache1.conf cron.conf mysqld.conf qpopper.conf syslogd.conf
+ apache2.conf dhcpd3.conf ntpd.conf samba.conf thttpd.conf
+ asterisk.conf dovecot.conf openldap.conf saslauthd.conf tomcat5.conf
+ bind8.conf exim.conf postfix.conf sendmail.conf vsftpd.conf
Primijetite da je monit respawnable proces -- on ne starta kroz
/etc/init.d/monit skripte (tzv. System V init skripte), vec kroz
"padne" ili ga nehotice netko "ubije", on ce se automatski odmah pokrenuti
nazad.
- -- Dinko Korunic <kreator@carnet.hr> at Thu, 25 Oct 2007 12:06:37 +0200
+ -- Dinko Korunic <kreator@carnet.hr> at Tue, 19 Feb 2008 18:59:22 +0100
+monit-cn (1:4.8.1-5) stable; urgency=low
+
+ * popravljena greska u postinstu vezano uz sed na /etc/default/monit
+ * dodan mailman servis
+ * u update-monit.d dodana funkcionalnost vracanja defaultnih predlozaka --
+ pri tome se predlozak vraca u default stanje ako i dalje sadrzi genericko
+ CARNet zaglavlje sa upozorenjem
+
+ -- Dinko Korunic <kreator@carnet.hr> Tue, 19 Feb 2008 19:07:53 +0100
+
monit-cn (1:4.8.1-4) stable; urgency=low
* popravljena greska u defaultnom templateu za "alert on"
# disable monit startup
cp_check_and_sed '^startup[[:space:]]*=[[:space:]]*1' \
- '^startup[[:space:]]*=.*/startup=0/g' /etc/default/monit || true
+ '^s/startup[[:space:]]*=.*/startup=0/g' /etc/default/monit || true
# systemv part
echo "CN: Disabling monit SystemV script"
-# amavisd monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process amavisd with pidfile "/var/run/amavis/amavisd.pid"
group mail
-# aosi monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check aosi with pidfile "/var/run/aosi/aosi.pid"
start program = "/etc/init.d/aosi start"
-# apache monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process apache with pidfile "/var/run/apache.pid"
start program = "/etc/init.d/apache start"
-# apache2 monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process apache2 with pidfile "/var/run/apache2.pid"
start program = "/etc/init.d/apache2 start"
-# asterisk monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process asterisk with pidfile "/var/run/asterisk.pid"
start program = "/etc/init.d/asterisk start"
-# bind8 monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process bind with pidfile "/var/run/named.pid"
start program = "/etc/init.d/bind start"
-# bind9 monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process bind with pidfile "/var/run/bind/run/named.pid"
start program = "/etc/init.d/bind9 start"
-# clamd monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process clamd with pidfile "/var/run/clamav/clamd.pid"
group mail
-# crond monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process cron with pidfile "/var/run/cron.pid"
group system
-# dhcpd monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process dhcpd with pidfile "/var/run/dhcpd.pid"
start program = "/etc/init.d/dhcp3-server start"
-# dovecot monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process dovecot with pidfile "/var/run/dovecot/master.pid"
group mail
-# exim monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process exim4 with pidfile "/var/run/exim4/exim.pid"
group mail
-# freeradius monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check freeradius with pidfile "/var/run/freeradius/freeradius.pid"
start program = "/etc/init.d/freeradius start"
--- /dev/null
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
+
+check process mailman with pidfile "/var/run/mailman/mailman.pid"
+ start program = "/etc/init.d/mailman start"
+ stop program = "/etc/init.d/mailman stop"
-# mysql monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process mysql with pidfile "/var/run/mysqld/mysqld.pid"
start program = "/etc/init.d/mysql start"
-# ntp monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process ntpd with pidfile "/var/run/ntpd.pid"
start program = "/etc/init.d/ntpd start"
-# openldap monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process openldap with pidfile "/var/run/slapd/slapd.pid"
start program = "/etc/init.d/slapd start"
-# postfix monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process postfix with pidfile "/var/spool/postfix/pid/master.pid"
group mail
-# postgrey monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process postgrey with pidfile "/var/run/postgrey.pid"
group mail
-# proftpd monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process proftpd with pidfile "/var/run/proftpd.pid"
start program = "/etc/init.d/proftpd start"
-# qpopper monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process qpopper with pidfile "/var/run/popper.pid"
group mail
-# samba monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process smbd with pidfile "/var/run/samba/smbd.pid"
group system
-# saslauthd monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process saslauthd with pidfile "/var/run/saslauthd/saslauthd.pid"
group mail
-# sendmail monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process sendmail with pidfile "/var/run/sendmail.pid"
group mail
-# sophie monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process sophie with pidfile "/var/run/sophie/pid"
group mail
-# sshd monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process sshd with pidfile "/var/run/sshd.pid"
start program = "/etc/init.d/ssh start"
-# syslogd/klogd monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process syslogd with pidfile "/var/run/syslogd.pid"
start program = "/etc/init.d/sysklogd start"
-# thttpd monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process thttpd with pidfile "/var/run/thttpd.pid"
start program = "/etc/init.d/thttpd start"
-# tomcat5 monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process tomcat5 with pidfile "/usr/share/tomcat5/temp/tomcat5.pid"
start program = "/etc/init.d/tomcat5 start"
-# vsftpd monit-cn template
+## Begin - Generated by CARNet package monit-cn
+#
+# This is a monit-cn template file. REMOVE this whole comment block if
+# you DON'T WANT monit-cn to edit/remove/delete your configuration file.
+#
+## End - Generated by CARNet package monit-cn
check process vsftpd with pidfile "/var/run/vsftpd/vsftpd.pid"
start program = "/etc/init.d/vsftpd start"
MONIT_DIR=/etc/monit.d
TEMPLATES_DIR=/usr/share/monit-cn
+
check_service() {
RET=0
-
filename="$1"
+
if [ ! -r "$filename" ]; then
RET=1
return 1
return 0
}
+check_template() {
+ RET=0
+ filename="$1"
+ serviceconf=$(basename $i)
+
+ if [ ! -r "$1" ]; then
+ RET=1
+ return 1
+ fi
+
+ if [ ! -r "${TEMPLATES_DIR}/${serviceconf}" ]; then
+ RET=0
+ return 0
+ fi
+
+ if ! grep -q "^#.*monit-cn template file" "$filename"; then
+ RET=0
+ return 0
+ fi
+
+ if ! cmp -s "$filename" "${TEMPLATES_DIR}/${serviceconf}"; then
+ RET=1
+ return 1
+ fi
+
+ return $RET
+}
+
+
#####################################################################
changed=0
fi
for i in $(find "$MONIT_DIR" -name '*.conf'); do
+ check_template $i
+ if [ ! $RET -eq 0 ]; then
+ serviceconf=$(basename $i)
+ echo "CN: Restored default $serviceconf template"
+ cp -a "${TEMPLATES_DIR}/${serviceconf}" "$MONIT_DIR"
+ changed=1
+ fi
+done
+
+for i in $(find "$MONIT_DIR" -name '*.conf'); do
check_service $i
if [ ! $RET -eq 0 ]; then
serviceconf=$(basename $i)
for i in $(find "$TEMPLATES_DIR" -name '*.conf'); do
serviceconf=$(basename $i)
- if [ -r "$MONIT_DIR"/$serviceconf.disabled ]; then
- check_service "$MONIT_DIR"/$serviceconf.disabled
+ if [ -r "${MONIT_DIR}/${serviceconf}.disabled" ]; then
+ check_service "${MONIT_DIR}/${serviceconf}.disabled"
if [ $RET -eq 0 ]; then
- if [ ! -r "$MONIT_DIR"/$serviceconf ]; then
+ if [ ! -r "${MONIT_DIR}/${serviceconf}" ]; then
echo "CN: Enabled $serviceconf (previously disabled)"
- mv "$MONIT_DIR"/$serviceconf.disabled \
- "$MONIT_DIR"/$serviceconf
+ mv "${MONIT_DIR}/${serviceconf}.disabled" \
+ "${MONIT_DIR}/${serviceconf}"
changed=1
fi
fi
else
check_service $i
if [ $RET -eq 0 ]; then
- if [ ! -r "$MONIT_DIR"/$serviceconf ]; then
+ if [ ! -r "${MONIT_DIR}/${serviceconf}" ]; then
echo "CN: Enabled $serviceconf (new service)"
- cp -a $i "$MONIT_DIR"
+ cp -a $i "${MONIT_DIR}"
changed=1
fi
fi
fi
exit 0
+
+# vi:ft=sh