add multi-instances capability to startup script Generated with FreeBSD Port Tools 0.99
Responsible Changed From-To: freebsd-ports-bugs->dougb dougb@ wants this port PRs (via the GNATS Auto Assign Tool)
Please don't commit it now: it's buggy I'll work on it next week more seriously... --=20 *Geoffroy Desvernay* C.R.I - Administration syst=C3=A8mes et r=C3=A9seaux Ecole Centrale de Marseille
State Changed From-To: open->suspended Originator asked to hold off.
Seems to work this time... -- *Geoffroy Desvernay* C.R.I - Administration systèmes et réseaux Ecole Centrale de Marseille
This time the startup script seems to work as expected (last followup's=20 diff): - doesn't break old installs - add a 'mysql_instances' rc var to make more than one mysql server=20 start at boot - Permit to start/stop/... one instance at a time Copy-pasted from memcached's script for most :) --=20 *Geoffroy Desvernay* C.R.I - Administration syst=C3=A8mes et r=C3=A9seaux Ecole Centrale de Marseille
Please consider the attached, which has a few small tweaks: 1. The use of {brackets} around variable names are only really necessary when they are close to some other text. Adding new instances of them when they are not needed is frowned on. 2. Empty default variable assignments (: ${mysql_instances=""}) are not necessary or desirable. 3. You assigned mysql_dbdir=/var/db/mysql unconditionally, in spite of the mysql_dbdir variable. 4. I changed the bare test for the existence of mysql_instances for a case statement to check if $2 is in there. If it isn't, there should be an error. 5. I changed $0 to %%PREFIX%%/etc/rc.d/mysql-server in the invocation line. Please test this version and let me know if it works for you. Doug -- "We could put the whole Internet into a book." "Too practical." Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/
On 07/11/2011 07:13, Doug Barton wrote: > Please consider the attached, which has a few small tweaks: > > 1. The use of {brackets} around variable names are only really necessary > when they are close to some other text. Adding new instances of them > when they are not needed is frowned on. > > 2. Empty default variable assignments (: ${mysql_instances=""}) are not > necessary or desirable. > > 3. You assigned mysql_dbdir=/var/db/mysql unconditionally, in spite of > the mysql_dbdir variable. > > 4. I changed the bare test for the existence of mysql_instances for a > case statement to check if $2 is in there. If it isn't, there should be > an error. > > 5. I changed $0 to %%PREFIX%%/etc/rc.d/mysql-server in the invocation line. > > Please test this version and let me know if it works for you. > > > Doug > Just tested on our production server: it works for us(tm) * replaced : "$2 "*|*" $2 "*|*" $2") by: "$2 "*|*" $2 "*|*" $2"|"$2") to let it work in case there is only one instance * changed the pidfile just below, using ${_dbdir}/`/bin/hostname`.pid instead of ${mysql_dbdir}/`/bin/hostname`_${instance}.pid ($mysql_dbdir may not let instance's owner write pidfile) * added 'mysql_user' declaration and '_limits_args' to fix limits call if defined Sorry for the delay, we had some big electrical problems these weeks... And I'm better with /bin/sh than with 20 years-old UPS (even if not so good in /bin/sh ;) -- *Geoffroy Desvernay* C.R.I - Administration systèmes et réseaux Ecole Centrale de Marseille Tel: (+33|0)4 91 05 45 24 Fax: (+33|0)4 91 05 45 98 dgeo@centrale-marseille.fr
Any progress on a .10 update? I was sort of hoping to commit this new script along with the new version. Doug -- Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/
Same patch, with upstream upgrade (5.2.10) Includes a patch to auth_pam.c to let it compile (should disappear in next upstream release) Happy new year ! -- *Geoffroy Desvernay* C.R.I - Administration systèmes et réseaux Ecole Centrale de Marseille
dougb 2012-01-05 02:13:37 UTC FreeBSD ports repository Modified files: databases/mariadb-server Makefile distinfo pkg-plist databases/mariadb-server/files mysql-server.in Added files: databases/mariadb-server/files patch-plugin__auth_pam__auth_pam.c Log: Upgrade to version 5.2.10: * Introduce a PAM authentication plugin * Various bug fixes For the rc.d script, add the ability to run multiple instances PR: ports/161883 Submitted by: Geoffroy Desvernay <dgeo@centrale-marseille.fr> (maintainer) Revision Changes Path 1.15 +1 -1 ports/databases/mariadb-server/Makefile 1.9 +2 -2 ports/databases/mariadb-server/distinfo 1.5 +65 -9 ports/databases/mariadb-server/files/mysql-server.in 1.1 +10 -0 ports/databases/mariadb-server/files/patch-plugin__auth_pam__auth_pam.c (new) 1.7 +8 -0 ports/databases/mariadb-server/pkg-plist _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: suspended->closed Committed, thanks for all your hard work and patience. :)
The rc.d script is broken. mysql_dbdir is not used anymore when looking for the datadir and the configuration file even though it's defined in rc.conf. mysql_enable="YES" mysql_dbdir="/dbs/mysql" This is what is launched mysql 72088 0.0 0.0 8328 1836 ?? Is 11:40AM 0:00.01 /bin/sh /usr/local/bin/mysqld_safe --defaults-extra-file=/var/db/mysql/my.cnf --user=mysql --datadir=/var/db/mysql --pid-file=/dbs/mysql/host.net.pid Cheers, Olivier
On 09.01.2012 12:08, interfaSys sà rl wrote: > The rc.d script is broken. > mysql_dbdir is not used anymore when looking for the datadir and the > configuration file even though it's defined in rc.conf. > > mysql_enable="YES" > mysql_dbdir="/dbs/mysql" > > > This is what is launched > mysql 72088 0.0 0.0 8328 1836 ?? Is 11:40AM 0:00.01 /bin/sh > /usr/local/bin/mysqld_safe --defaults-extra-file=/var/db/mysql/my.cnf > --user=mysql --datadir=/var/db/mysql --pid-file=/dbs/mysql/host.net.pid > > > Cheers, > > Olivier I found another bug: did not taks '_user' into account for different instances. Patch attached to correct this Thanks ! -- *geoffroy desvernay* C.R.I - Administration systèmes et réseaux Ecole Centrale de Marseille