init.d script for running second mysql server fails [closed]
Domanda
I have 2 mysql servers, one is set with all the mysql defaults (port,socket, etc.) and the second is set to port 3307 and a different socket with defaults file called my-dev.cnf .
when i run:
/usr/bin/mysqld_safe --defaults-file=/etc/my-dev.cnf
the server runs correctly
what i'm trying to do, is to have an init.d script to run it. I copied the /etc/init.d/mysqld script and changed the following line:
exec="/usr/bin/mysqld_safe"
to:
exec="/usr/bin/mysqld_safe --defaults-file=/etc/my-dev.cnf"
but it keeps failing on:
[ -x $exec ] || exit 5
with:
/etc/init.d/mysql-dev: line 63: [: '/usr/bin/mysqld_safe': binary operator expected
how can i make it work so it will use the defaults i set in /etc/my-dev.cnf?
thanks!
Soluzione
The problem is that [ -x ]
is testing if a file is executable, but the string is not an executable, it's your modified command line.
Paste the whole script on http://pastie.org , I will adapt it ;)