debian-start 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. #
  3. # This script is executed by "/etc/init.d/mysql" on every (re)start.
  4. #
  5. # Changes to this file will be preserved when updating the Debian package.
  6. #
  7. source /usr/share/mysql/debian-start.inc.sh
  8. MYSQL="/usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf"
  9. MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
  10. MYUPGRADE="/usr/bin/mysql_upgrade --defaults-extra-file=/etc/mysql/debian.cnf"
  11. MYCHECK="/usr/bin/mysqlcheck --defaults-file=/etc/mysql/debian.cnf"
  12. MYCHECK_SUBJECT="WARNING: mysqlcheck has found corrupt tables"
  13. MYCHECK_PARAMS="--all-databases --fast --silent"
  14. MYCHECK_RCPT="root"
  15. # The following commands should be run when the server is up but in background
  16. # where they do not block the server start and in one shell instance so that
  17. # they run sequentially. They are supposed not to echo anything to stdout.
  18. # If you want to disable the check for crashed tables comment
  19. # "check_for_crashed_tables" out.
  20. # (There may be no output to stdout inside the background process!)
  21. echo "Checking for tables which need an upgrade, are corrupt or were "
  22. echo "not closed cleanly."
  23. (
  24. upgrade_system_tables_if_necessary;
  25. check_root_accounts;
  26. check_for_crashed_tables;
  27. ) >&2 &
  28. exit 0