summaryrefslogtreecommitdiff
path: root/debian/postinst
blob: c72c7ac8a1457be60f0462ed9cfceec0e1ed8de7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
#
# Once we've installed the package explicitly flush the queue,
# to cover cases when the format changes.
#
# If we're running @Bytemark restart the worker processes
#

set -e


#
# Skip, if we are not in "configure" state
#
if [ "$1" != "configure" ]; then
        echo "I: Skipping configuration"
        exit 0
fi


#
# 1.  Flush the queue
#
custodian-queue --flush || true

#
# 2.  If we have agents then restart them
#
if [ -d /etc/service ]; then
   test -d /etc/service/custodian-agent1 && sv restart /etc/service/custodian-agent1/
   test -d /etc/service/custodian-agent2 && sv restart /etc/service/custodian-agent2/
   test -d /etc/service/custodian-agent3 && sv restart /etc/service/custodian-agent3/
   test -d /etc/service/custodian-agent4 && sv restart /etc/service/custodian-agent4/
fi

#DEBHELPER#
exit 0