fix a few minor things in run_unit_privileged
@@ -8,11 +8,12 @@ function initialize_mysql {
[mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
EOF
- $datadir=/mysql-datadir
+ datadir=/mysql-datadir
+ escaped_datadir=${datadir/\//\\\/}
mkdir $datadir
mount -t tmpfs -o size=2g tmpfs $datadir
rsync -av --progress /var/lib/mysql/ $datadir
- sed -i /etc/mysql/mysql.conf.d/mysqld.conf "s/datadir.*/datadir=$datadir"
+ sed -i "s/datadir.*/datadir=${escaped_datadir}/g" /etc/mysql/mysql.conf.d/mysqld.cnf
}
if [ "${SQL_FLAVOR}" = "mysql" ]; then
