Commit 516d78c6 authored by Patrick J Cherry's avatar Patrick J Cherry Committed by telyn
Browse files

Move the monit scripts to /usr and re-instate with symlinks in postinst

This is a model commit to show how to move the "hard-coded" monit
scripts into /usr and replace them back into /etc/symbiosis/monit.d with
symlinks.
parent 84e1e331
exim4/ etc/
dovecot/ etc/
sbin/ usr/
symbiosis/ etc/
symbiosis/firewall etc/symbiosis
symbiosis/test.d etc/symbiosis
symbiosis/monit.d/* usr/share/symbiosis/monit/checks/
......@@ -6,3 +6,8 @@ rm_conffile /etc/symbiosis/monit.d/clamav-freshclam 2014:1231
rm_conffile /etc/symbiosis/test.d/exim4_acl_tests/testy 2010:0101
rm_conffile /etc/symbiosis/test.d/exim4_acl_tests/test2 2010:0101
rm_conffile /etc/symbiosis/test.d/exim4_acl_tests/test3 2010:0101
rm_conffile /etc/symbiosis/monit.d/spamassassin 2016:0101
rm_conffile /etc/symbiosis/monit.d/exim4 2016:0101
rm_conffile /etc/symbiosis/monit.d/dovecot 2016:0101
rm_conffile /etc/symbiosis/monit.d/clamav-freshclam 2016:0101
rm_conffile /etc/symbiosis/monit.d/clamav-daemon 2016:0101
......@@ -136,12 +136,26 @@ if [ -e /etc/dovecot/Makefile ] ; then
cd /etc/dovecot && make dovecot.conf
fi
monit_dir="/etc/symbiosis/monit.d"
mkdir -p "$monit_dir"
#
# Restart all deamons
#
for i in exim4 dovecot spamassassin clamav-daemon symbiosis-email-dict-proxy symbiosis-email-poppassd; do
# spamassassin + clamav-daemon might not be installed. Wrap the invokation.
service $i restart || true
#
# Add symlinks for our symbiosis monit scripts (one per service, possibly)
#
monit_script="/usr/share/symbiosis/monit/checks/$i"
link_target="$monit_dir/$i"
if [ -x "$monit_script" ] && [ ! -e "$link_target" ] ; then
echo "I: Adding symlink for Symbiosis Monit script for $i"
ln -s "$monit_script" "$link_target" || true
fi
done
#DEBHELPER#
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment