~sinzui/juju-ci-tools/repository

« back to all changes in this revision

Viewing changes to xenial/mysql/hooks/upgrade-charm

  • Committer: Curtis Hovey
  • Date: 2015-11-06 15:43:36 UTC
  • Revision ID: curtis@hovey.name-20151106154336-soncn5peue27jtr0
Added xenial.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
home=`dirname $0`
 
3
# Remove any existing .service_user files, which will cause
 
4
# new users/pw's to be generated, which is a good thing
 
5
old_service_user_files=$(ls /var/lib/juju/*.service_user)
 
6
if [ -n "$old_service_user_files" ] ; then
 
7
    juju-log -l WARNING "Stale users left around, should be revoked: $(cat $old_service_user_files)"
 
8
    rm -f $old_service_user_files
 
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
 
 
26
$home/install
 
27
exec $home/config-changed