3
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; version 2 of the License.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ];
20
. /usr/share/debconf/confmodule
23
place_upstart_job_back () {
24
if [ -e "/var/lib/mysql/.mysql.conf.backup" ];
26
mv /var/lib/mysql/.mysql.conf.backup /etc/init/mysql.conf
31
PSCOUNT=$(ps -ef | grep "/usr/sbin/mysqld" | wc -l)
41
if [ "${PSCOUNT}" -eq 1 ];
46
if [ "${COUNT}" -gt 15 ];
62
place_upstart_job_back
72
place_upstart_job_back
74
MYSQLDATA=/var/lib/mysql
75
MYSQLLOG=/var/log/mysql
76
MYSQLRUN=/var/run/mysqld
80
db_input high mysql-community-server/remove-data-dir || true
82
db_get mysql-community-server/remove-data-dir && RMDATADIR=${RET}
83
if [ "${RMDATADIR}" = "true" ];
85
if [ -d ${MYSQLRUN} ] || [ -L ${MYSQLRUN} ];
90
if [ -d ${MYSQLLOG} ] || [ -L ${MYSQLLOG} ];
95
if [ -d ${MYSQLDATA} ] || [ -L ${MYSQLDATA} ];
100
if getent passwd mysql >/dev/null;
113
place_upstart_job_back
115
if [ -x "/etc/init.d/mysql" ];
117
invoke-rc.d mysql start || exit $?
119
if [ -d ${MYSQLRUN} ] || [ -L ${MYSQLRUN} ];
124
if [ -d ${MYSQLLOG} ] || [ -L ${MYSQLLOG} ];
129
if [ -d ${MYSQLDATA} ] || [ -L ${MYSQLDATA} ];
134
if getent passwd mysql >/dev/null;
143
upgrade|abort-upgrade)