Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

Commit 2d2b9ff

Browse files
Merge pull request #2 from Lullabot/post-checkout-hook
Add a post-checkout hook.
2 parents 742a581 + 6f7e2df commit 2d2b9ff

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ The easiest way to get going is to use https://github.com/Lullabot/trusty32-lamp
2626
which includes these commands. Otherwise, these scripts expect a
2727
thinly-provisioned LVM volume named "master" in a "mysql" volume group.
2828

29+
LMM supports the following hooks in `/etc/lmm`. Each hook must be an executable
30+
file.
31+
32+
* `post-checkout`
33+
34+
An example `post-checkout` hook to clear memcache when switching databases:
35+
36+
```sh
37+
#!/bin/bash
38+
39+
echo 'flush_all' | nc 127.0.0.1 11211
40+
```
41+
2942
Examples
3043
--------
3144

functions.sh

+4
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,9 @@ checkout() {
111111
echo "Setting $VG_PATH/$1 as the active database."
112112
rm /var/lib/mysql
113113
ln -s $VG_PATH/$1 /var/lib/mysql
114+
if [[ -x "/etc/lmm/post-checkout" ]]
115+
then
116+
/etc/lmm/post-checkout
117+
fi
114118
service mysql start
115119
}

0 commit comments

Comments
 (0)