@@ -60,11 +60,11 @@ case "$1" in
6060 fi
6161 fi
6262
63- mysql_statedir =/usr/share/mariadb
64- mysql_datadir =/var/lib/mysql
65- mysql_logdir =/var/log/mysql
66- mysql_cfgdir =/etc/mysql
67- mysql_upgradedir =/var/lib/mysql-upgrade
63+ mariadb_statedir =/usr/share/mariadb
64+ mariadb_datadir =/var/lib/mysql
65+ mariadb_logdir =/var/log/mysql
66+ mariadb_cfgdir =/etc/mysql
67+ mariadb_upgradedir =/var/lib/mysql-upgrade
6868
6969 # If the following symlink exists, it is a preserved copy the old data dir
7070 # created by the preinst script during a upgrade that would have otherwise
@@ -74,12 +74,12 @@ case "$1" in
7474
7575 if [ " $dir " = " DATADIR" ]
7676 then
77- targetdir=$mysql_datadir
77+ targetdir=$mariadb_datadir
7878 else
79- targetdir=$mysql_logdir
79+ targetdir=$mariadb_logdir
8080 fi
8181
82- savelink=" $mysql_upgradedir /$dir .link"
82+ savelink=" $mariadb_upgradedir /$dir .link"
8383 if [ -L " $savelink " ]
8484 then
8585 # If the targetdir was a symlink before we upgraded it is supposed
@@ -92,10 +92,10 @@ case "$1" in
9292 mv " $savelink " " $targetdir "
9393 else
9494 # this should never even happen, but just in case...
95- mysql_tmp =$( mktemp -d -t mysql -symlink-restore-XXXXXX)
96- echo " this is very strange! see $mysql_tmp /README..." >&2
97- mv " $targetdir " " $mysql_tmp "
98- cat << EOF > "$mysql_tmp /README"
95+ mariadb_tmp =$( mktemp -d -t mariadb -symlink-restore-XXXXXX)
96+ echo " this is very strange! see $mariadb_tmp /README..." >&2
97+ mv " $targetdir " " $mariadb_tmp "
98+ cat << EOF > "$mariadb_tmp /README"
9999
100100If you're reading this, it's most likely because you had replaced /var/lib/mysql
101101with a symlink, then upgraded to a new version of mysql, and then dpkg
@@ -110,7 +110,7 @@ this all away.
110110EOF
111111 fi
112112 fi
113- rmdir $mysql_upgradedir 2> /dev/null || true
113+ rmdir $mariadb_upgradedir 2> /dev/null || true
114114
115115 done
116116
@@ -122,38 +122,38 @@ EOF
122122 # This direct update is needed to enable an authentication mechanism to
123123 # perform mariadb-upgrade, (MDEV-22678). To keep the impact minimal, we
124124 # skip innodb and set key-buffer-size to 0 as it isn't reused.
125- if [ -f " $mysql_datadir /auto.cnf" ] &&
126- [ -f " $mysql_datadir /mysql/user.MYD" ] &&
127- ! lsof -nt " $mysql_datadir " /mysql/user.MYD > /dev/null &&
128- [ ! -f " $mysql_datadir /undo_001" ]
125+ if [ -f " $mariadb_datadir /auto.cnf" ] &&
126+ [ -f " $mariadb_datadir /mysql/user.MYD" ] &&
127+ ! lsof -nt " $mariadb_datadir " /mysql/user.MYD > /dev/null &&
128+ [ ! -f " $mariadb_datadir /undo_001" ]
129129 then
130130 echo " UPDATE mysql.user SET plugin='unix_socket' WHERE plugin='auth_socket';" |
131131 mariadbd --skip-innodb --key_buffer_size=0 --default-storage-engine=MyISAM --bootstrap 2> /dev/null
132132 fi
133133
134134 # Ensure the existence and right permissions for the database and
135135 # log files. Use mkdir option 'Z' to create with correct SELinux context.
136- if [ ! -d " $mysql_statedir " ] && [ ! -L " $mysql_statedir " ]
136+ if [ ! -d " $mariadb_statedir " ] && [ ! -L " $mariadb_statedir " ]
137137 then
138- mkdir -Z " $mysql_statedir "
138+ mkdir -Z " $mariadb_statedir "
139139 fi
140- if [ ! -d " $mysql_datadir " ] && [ ! -L " $mysql_datadir " ]
140+ if [ ! -d " $mariadb_datadir " ] && [ ! -L " $mariadb_datadir " ]
141141 then
142- mkdir -Z " $mysql_datadir "
142+ mkdir -Z " $mariadb_datadir "
143143 fi
144- if [ ! -d " $mysql_logdir " ] && [ ! -L " $mysql_logdir " ]
144+ if [ ! -d " $mariadb_logdir " ] && [ ! -L " $mariadb_logdir " ]
145145 then
146- mkdir -Z " $mysql_logdir "
146+ mkdir -Z " $mariadb_logdir "
147147 fi
148148 # When creating an ext3 jounal on an already mounted filesystem like e.g.
149149 # /var/lib/mysql, you get a .journal file that is not modifiable by chown.
150- # The mysql_statedir must not be writable by the mysql user under any
150+ # The mariadb_statedir must not be writable by the mysql user under any
151151 # circumstances as it contains scripts that are executed by root.
152152 set +e
153- chown -R 0:0 $mysql_statedir
154- find $mysql_datadir ! -uid " $( id -u mysql) " -print0 | xargs -0 -r chown mysql
155- chown -R mysql:adm $mysql_logdir
156- chmod 2750 $mysql_logdir
153+ chown -R 0:0 $mariadb_statedir
154+ find $mariadb_datadir ! -uid " $( id -u mysql) " -print0 | xargs -0 -r chown mysql
155+ chown -R mysql:adm $mariadb_logdir
156+ chmod 2750 $mariadb_logdir
157157 set -e
158158
159159 # # Set the correct filesystem ownership for the PAM v2 plugin
@@ -176,14 +176,14 @@ EOF
176176 chown mysql /usr/lib/mysql/plugin/auth_pam_tool_dir
177177
178178 # This is important to avoid dataloss when there is a removed
179- # mysql -server version from Woody lying around which used the same
179+ # mariadb -server version from Woody lying around which used the same
180180 # data directory and then somehow gets purged by the admin.
181181 db_set mariadb-server/postrm_remove_database false || true
182182
183183 # Clean up old flags before setting new one
184- rm -f $mysql_datadir /debian-* .flag
184+ rm -f $mariadb_datadir /debian-* .flag
185185 # Flag data dir to avoid downgrades
186- touch " $mysql_datadir /debian-__MARIADB_MAJOR_VER__.flag"
186+ touch " $mariadb_datadir /debian-__MARIADB_MAJOR_VER__.flag"
187187
188188 # initiate databases. Output is not allowed by debconf :-(
189189 # This will fail if we are upgrading an existing database; in this case
@@ -205,10 +205,10 @@ EOF
205205 # --defaults-file option for tools (for the sake of upgrades)
206206 # and thus need /etc/mysql/debian.cnf to exist, even if it's empty.
207207 # In the long run the goal is to obsolete this file.
208- dc=" $mysql_cfgdir /debian.cnf"
209- if [ ! -d " $mysql_cfgdir " ]
208+ dc=" $mariadb_cfgdir /debian.cnf"
209+ if [ ! -d " $mariadb_cfgdir " ]
210210 then
211- install -o 0 -g 0 -m 0755 -d $mysql_cfgdir
211+ install -o 0 -g 0 -m 0755 -d $mariadb_cfgdir
212212 fi
213213 if [ ! -e " $dc " ]
214214 then
224224 echo " [client]" ;
225225 echo " host = localhost" ;
226226 echo " user = root" ;
227- echo " [mysql_upgrade ]" ;
227+ echo " [mariadb_upgrade ]" ;
228228 echo " host = localhost" ;
229229 echo " user = root" ;
230230 echo " # THIS FILE WILL BE REMOVED IN A FUTURE DEBIAN RELEASE." ;
0 commit comments