~brad-marshall/charms/trusty/memcached/add-monitors-relation

« back to all changes in this revision

Viewing changes to hooks/install

  • Committer: Matthew Wedgwood
  • Date: 2013-04-18 16:23:01 UTC
  • mfrom: (51.1.8 memcached)
  • Revision ID: matthew.wedgwood@canonical.com-20130418162301-837pve3uzjc7v4h0
[mthaddon] support for pre-install hook structure, support for the nrpe-external-master charm

This adds support for pre-install hook structure, as supported in a number of other charms, which allows you to do things like set timezone, install custom apt repositories, etc.. It also adds support for the nrpe-external-master charm

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/bash
2
2
 
3
3
set -e
 
4
if [[ -d exec.d ]]; then
 
5
    shopt -s nullglob
 
6
    for f in exec.d/*/charm-pre-install; do 
 
7
        [[ -x "$f" ]] || continue
 
8
        ${SHELL} -c "$f"|| {
 
9
            ## bail out if anyone fails
 
10
            juju-log -l ERROR "$f: returned exit_status=$? "
 
11
            exit 1
 
12
        }
 
13
    done
 
14
fi
4
15
 
5
 
DEBIAN_FRONTEND=noninteractive apt-get -y install -qq memcached
 
16
DEBIAN_FRONTEND=noninteractive apt-get -y install -qq memcached python-cheetah python-memcache
6
17
 
7
18
cat > /etc/default/memcached <<EOF
8
19
ENABLE_MEMCACHED=yes