install: do not delete contents of /var/lib/mysql/

We now use mysql commands to check of the database exists.
This commit is contained in:
Sameer Naik 2013-10-28 23:01:31 +05:30
parent 4263e85730
commit dd44c2b6cd
2 changed files with 1 additions and 5 deletions

View File

@ -72,9 +72,6 @@ sudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab
# create the /var/run/sshd directory (required for sshd to start)
mkdir -p /var/run/sshd
# clear mysql database
rm -rf /var/lib/mysql/*
# configure nginx
sed 's/YOUR_SERVER_FQDN/localhost/' -i /etc/nginx/sites-available/gitlab
echo "daemon off;" >> /etc/nginx/nginx.conf

View File

@ -22,9 +22,8 @@ DB_POOL=${DB_POOL:-5}
# start mysql server if ${DB_HOST} is localhost
if [ "${DB_HOST}" == "localhost" ]; then
if [ ! -d /var/lib/mysql/mysql ]; then
if ! echo "USE ${DB_NAME}" | mysql -uroot ${DB_PASS:+-p$DB_PASS} >/dev/null 2>&1; then
DB_INIT="yes"
mysql_install_db --user=mysql
fi
cat > /etc/supervisor/conf.d/mysqld.conf <<EOF