Просмотр исходного кода

Fix MySQL autostart issue on Ubuntu 14.04

Serghey Rodin 11 лет назад
Родитель
Сommit
62c05fb08f
3 измененных файлов с 19 добавлено и 1 удалено
  1. 3 1
      install/vst-install-ubuntu.sh
  2. 5 0
      src/deb/vesta/postinst
  3. 11 0
      upd/fix_mysql_startup.sh

+ 3 - 1
install/vst-install-ubuntu.sh

@@ -601,7 +601,9 @@ fi
 mpass=$(gen_pass)
 wget $CHOST/$VERSION/my.cnf -O /etc/mysql/my.cnf
 mysql_install_db
-update-rc.d mysql defaults
+if [ "$release" != '14.04' ]; then
+    update-rc.d mysql defaults
+fi
 service mysql stop > /dev/null 2>&1
 service mysql start
 if [ "$?" -ne 0 ]; then

+ 5 - 0
src/deb/vesta/postinst

@@ -15,4 +15,9 @@ if [ -x "/usr/local/vesta/upd/fix_vesta_ssl_permissions.sh" ]; then
     /usr/local/vesta/upd/fix_vesta_ssl_permissions.sh
 fi
 
+# Run MySQL autostart fixed
+if [ -x "/usr/local/vesta/upd/fix_mysql_startup.sh" ]; then
+    /usr/local/vesta/upd/fix_mysql_startup.sh
+fi
+
 exit 0

+ 11 - 0
upd/fix_mysql_startup.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# Fix MySQL autostart for Ubuntu 14.04
+if [ -e "/etc/issue" ]; then
+    release=$(head -n 1 /etc/issue | cut -f 2 -d ' ' )
+    if [ "$release" = '14.04' ]; then
+        update-rc.d mysql disable
+    fi
+fi
+
+exit