diff options
author | unknown <knielsen@knielsen-hq.org> | 2009-10-23 13:43:17 +0200 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2009-10-23 13:43:17 +0200 |
commit | b9f5aba8e44f8790366b51f98eec819f10ef65ab (patch) | |
tree | 7c6e353daf7d04869e797596bb3dffdaccab6332 /support-files | |
parent | 1b7d4b37b4656723d898379e13830543c4d8bd45 (diff) | |
parent | c4f5fc85c4106b41f0a5b65a61db19d94f909a1e (diff) | |
download | mariadb-git-b9f5aba8e44f8790366b51f98eec819f10ef65ab.tar.gz |
Merge Peter Lieverdink's fixes:
- configtest target in rc script.
- type fix usefull -> useful.
Diffstat (limited to 'support-files')
-rw-r--r-- | support-files/mysql.server.sh | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh index 87198fc9cf5..fe885122e8c 100644 --- a/support-files/mysql.server.sh +++ b/support-files/mysql.server.sh @@ -434,9 +434,36 @@ case "$mode" in fi fi ;; - *) + 'configtest') + # Safeguard (relative paths, core dumps..) + cd $basedir + echo $echo_n "Testing MySQL configuration syntax" + daemon=$bindir/mysqld + if test -x $libexecdir/mysqld + then + daemon=$libexecdir/mysqld + elif test -x $sbindir/mysqld + then + daemon=$sbindir/mysqld + elif test -x `which mysqld` + then + daemon=`which mysqld` + else + log_failure_msg "Unable to locate the mysqld binary!" + exit 1 + fi + help_out=`$daemon --help 2>&1`; r=$? + if test "$r" != 0 ; then + log_failure_msg "$help_out" + log_failure_msg "There are syntax errors in the server configuration. Please fix them!" + else + log_success_msg "Syntax OK" + fi + exit $r + ;; + *) # usage - echo "Usage: $0 {start|stop|restart|reload|force-reload|status} [ MySQL server options ]" + echo "Usage: $0 {start|stop|restart|reload|force-reload|status|configtest} [ MySQL server options ]" exit 1 ;; esac |