~nick-moffitt/charms/precise/mysql/mysql-shopt-is-a-shell-builtin

« back to all changes in this revision

Viewing changes to hooks/upgrade-charm

  • Committer: Marco Ceppi
  • Date: 2013-05-30 16:00:47 UTC
  • mfrom: (91.2.17 mysql)
  • Revision ID: marco@ceppi.net-20130530160047-i68avmlzo6go3sny
ha-support: https://code.launchpad.net/~openstack-charmers/charms/precise/mysql/ha-support/+merge/165059

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
home=`dirname $0`
3
3
# Remove any existing .service_user files, which will cause
4
4
# new users/pw's to be generated, which is a good thing
5
 
old_service_user_files=$(ls /var/lib/juju/$.service_user)
 
5
old_service_user_files=$(ls /var/lib/juju/*.service_user)
6
6
if [ -n "$old_service_user_files" ] ; then
7
7
    juju-log -l WARNING "Stale users left around, should be revoked: $(cat $old_service_user_files)"
8
8
    rm -f $old_service_user_files
9
9
fi
 
10
 
 
11
# Move service_user2 files to /var/lib/mysql as they are
 
12
# now stored there to support HA clustering with ceph.
 
13
new_service_user_files=$(ls /var/lib/juju/*.service_user2)
 
14
if [ -n "$new_service_user_files" ]; then
 
15
    juju-log -l INFO "Moving service_user files [$new_service_user_files] to [/var/lib/mysql]"
 
16
    mv $new_service_user_files /var/lib/mysql/
 
17
fi
 
18
# Move passwd files to /var/lib/mysql as they are
 
19
# now stored there to support HA clustering with ceph.
 
20
password_files=$(ls /var/lib/juju/*.passwd)
 
21
if [ -n "$password_files" ]; then
 
22
    juju-log -l INFO "Moving passwd files [$password_files] to [/var/lib/mysql]"
 
23
    mv $password_files /var/lib/mysql/
 
24
fi
 
25
 
10
26
$home/install
11
27
exec $home/config-changed