blob: 9f9d8851fdae81d091c069346020c00ba0156045 [file] [log] [blame]
Joshua Heskethdd650602013-08-21 12:18:50 +10001#!/bin/bash -x
2
3# $1 is the db engine name, currently one of:
4# mysql
Joshua Heskethbacf1892013-09-09 11:30:39 +10005# percona
Joshua Heskethdd650602013-08-21 12:18:50 +10006
7git pull
8
9# Percona support
10apt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
11cp etc/percona.list /etc/apt/sources.list.d/percona.list
12
13apt-get update
14apt-get dist-upgrade -y
15apt-get install -y git python-pip libxml2-dev libxml2-utils libxslt-dev libmysqlclient-dev pep8 postgresql-server-dev-9.1 python2.7-dev python-coverage python-netaddr python-mysqldb $1-server python-git virtualenvwrapper python-numpy
16
17mkdir -p /var/log/mysql
18touch /var/log/mysql/slow-queries.log
19chown mysql.mysql /var/log/mysql/slow-queries.log
20
21chmod ugo+rx /var/log/mysql
22chmod ugo+r /var/log/syslog /var/log/mysql/slow-queries.log /var/log/mysql/error.log
23
Joshua Heskethdd650602013-08-21 12:18:50 +100024if [ -e /etc/logrotate.d/percona-server-server-5.5 ]
25then
26 rm /etc/logrotate.d/percona-server-server-5.5
27fi
28/usr/sbin/logrotate /etc/logrotate.conf
29
30/etc/init.d/apparmor restart
31/etc/init.d/mysql restart
Joshua Heskethe13932b2013-09-06 16:45:33 +100032
33mkdir -p /var/log/turbo-hipster
34chown turbo-hipster:turbo-hipster /var/log/turbo-hipster
35
36mkdir -p /var/lib/turbo-hipster
37chown turbo-hipster:turbo-hipster /var/log/turbo-hipster
Joshua Hesketh055a08b2013-09-06 16:48:41 +100038
39mysql -u root -e "create user 'nova'@'localhost' identified by 'tester';"
40mysql -u root -e "grant all privileges on nova.* TO 'nova'@'localhost';"