diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e594810 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.rpm +*.log +*spec-20* +*.tar.xz diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d2c4a2a --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +# Makefile for source rpm: smeserver-mysql +# $Id: Makefile,v 1.1 2022/03/13 01:13:30 jpp Exp $ +NAME := smeserver-mysql +SPECFILE = $(firstword $(wildcard *.spec)) + +define find-makefile-common +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +endef + +MAKEFILE_COMMON := $(shell $(find-makefile-common)) + +ifeq ($(MAKEFILE_COMMON),) +# attept a checkout +define checkout-makefile-common +test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 +endef + +MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) +endif + +include $(MAKEFILE_COMMON) diff --git a/README.md b/README.md index fa25aa9..c58458e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,20 @@ -# smeserver-mysql +# smeserver-mysql -SMEServer Koozali developed git repo for smeserver-mysql smeserver \ No newline at end of file +SMEServer Koozali developed git repo for smeserver-mysql smeserver + +## Wiki +
https://wiki.koozali.org/MySQL +
https://wiki.koozali.org/Upgrade_php/mysql +
https://wiki.koozali.org/MySQL/fr +
https://wiki.koozali.org/MySQL/de +
https://wiki.koozali.org/MariaDB_alongside_MySQL +
https://wiki.koozali.org/Software_Collections:MySQL + +## Bugzilla +Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=smeserver-mysql&product=SME%20Server%2010.X&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED) + +## Description + +
*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.* +*Once it has been checked, then this comment will be deleted* +
diff --git a/additional/COPYING b/additional/COPYING new file mode 100644 index 0000000..eeb586b --- /dev/null +++ b/additional/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/additional/rootscl/etc/e-smith/events/actions/mariadb_VER_-delete-db-files b/additional/rootscl/etc/e-smith/events/actions/mariadb_VER_-delete-db-files new file mode 100644 index 0000000..b20ce36 --- /dev/null +++ b/additional/rootscl/etc/e-smith/events/actions/mariadb_VER_-delete-db-files @@ -0,0 +1,3 @@ +#! /bin/sh + +cd /var/opt/rh/rh-mariadb!!!VER!!!/lib/mysql && find . -type f | xargs rm -f diff --git a/additional/rootscl/etc/e-smith/events/actions/mariadb_VER_-delete-dumped-tables b/additional/rootscl/etc/e-smith/events/actions/mariadb_VER_-delete-dumped-tables new file mode 100644 index 0000000..08fdc2b --- /dev/null +++ b/additional/rootscl/etc/e-smith/events/actions/mariadb_VER_-delete-dumped-tables @@ -0,0 +1,3 @@ +#!/bin/sh + +exec /bin/rm -f /home/e-smith/db/mariadb!!!VER!!!/*.dump diff --git a/additional/rootscl/etc/e-smith/events/actions/mariadb_VER_-dump-tables b/additional/rootscl/etc/e-smith/events/actions/mariadb_VER_-dump-tables new file mode 100644 index 0000000..ed28d12 --- /dev/null +++ b/additional/rootscl/etc/e-smith/events/actions/mariadb_VER_-dump-tables @@ -0,0 +1,58 @@ +#!/bin/sh + +# We have to re-enable SCL environment, because /sbin/service +# clears almost all environment variables. +# Since X_SCLS is cleared as well, we lose information about other +# collections enabled. +. /opt/rh/rh-mariadb!!!VER!!!/service-environment +for sclname in $RH_MARIADB!!!VER!!!_SCLS_ENABLED ; do + . /opt/rh/$sclname/enable + export X_SCLS="$X_SCLS $sclname" +done + +# we want start daemon only inside "scl enable" invocation +if ! scl_enabled $sclname ; then + echo "Collection $sclname has to be listed in /opt/rh/rh-mariadb!!!VER!!!/service-environment" + exit 1 +fi + + +status=$(/sbin/e-smith/config getprop mariadb status) +fixtables=$(/sbin/e-smith/config getprop mariadb autofixtables || echo "disabled") +if [ "$fixtables" = "enabled" ]; then + /sbin/e-smith/config delprop mariadb failsbackup +fi +failsbackup=$(/sbin/e-smith/config getprop mariadb failsbackup || echo "disabled") + + +onfailure () { + db=$1 + message="" + if [ "$failsbackup" = "enabled" ]; then + exit 1; + message="There was an error trying to dump database $db, please fix this db. We stop there without backups." + echo $message + echo $message | /usr/bin/mail -s "error on backup of $db MariaDB !!!VER!!! database" admin + fi + message="$message \nThere was an error trying to dump database $db, please check for table errors in this db. Forcing a backup of the corrupted DB." + /opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysqldump --socket=!!!SOCKET!!! --force --ignore-table=mysql.event --single-transaction --add-drop-table -QB "$db" -r /home/e-smith/db/mariadb!!!VER!!!/"$db"-failed.dump || message="$message \nFailed to force backup of corrupted db $db as $db-failed.dump" >&2 + if [ "$fixtables" = "enabled" ]; then + repair="failure" + message="$message \nTrying to auto-repair the db and do a backup after..." + /opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysqlcheck --socket=!!!SOCKET!!! -s --auto-repair -c "$db" && \ + /opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysqldump --socket=!!!SOCKET!!! --ignore-table=mysql.event --single-transaction --add-drop-table -QB "$db" -r /home/e-smith/db/mariadb!!!VER!!!/"$db".dump && repair="success" + message="$message \n => $repair" + fi + echo $message + echo $message | /usr/bin/mail -s "error on backup of $db MariaDB database" admin +} + +if [ "$status" = "disabled" ] +then + echo "mysqld is disabled - no tables dumped" >&2 + exit 0 +fi +for db in $(/opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysql --socket=!!!SOCKET!!! -BNre "show databases;"|egrep -vi "^information_schema$|^performance_schema$") +do + /opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysqldump --socket=!!!SOCKET!!! --ignore-table=mysql.event --single-transaction --add-drop-table -QB "$db" -r /home/e-smith/db/mariadb!!!VER!!!/"$db".dump || onfailure $db +done diff --git a/additional/rootscl/etc/e-smith/events/actions/mariadb_VER_-load-tables b/additional/rootscl/etc/e-smith/events/actions/mariadb_VER_-load-tables new file mode 100644 index 0000000..81f03c1 --- /dev/null +++ b/additional/rootscl/etc/e-smith/events/actions/mariadb_VER_-load-tables @@ -0,0 +1,17 @@ +#!/bin/sh + +status=$(/sbin/e-smith/config getprop mariadb!!!VER!!!-mariadb status) +if [ "$status" = "disabled" ] +then + echo "mysqld is disabled - no tables restored" >&2 + exit 0 +fi +/bin/rm -f /home/e-smith/db/mariadb!!!VER!!!/information_schema.dump +/bin/rm -f /home/e-smith/db/mariadb!!!VER!!!/performance_schema.dump +if [ ! -f /var/opt/rh/rh-mariadb!!!VER!!!/lib/mysql/mysql/user.frm ] +then + for db in $(ls /home/e-smith/db/mariadb!!!VER!!!/*.dump 2> /dev/null | grep -v '/mysql.dump') + do + mv $db /etc/e-smith/sql/init!!!VER!!!/01_$(basename $db .dump).sql + done +fi diff --git a/additional/rootscl/etc/e-smith/templates/etc/my.conf/_VER_-09socket b/additional/rootscl/etc/e-smith/templates/etc/my.conf/_VER_-09socket new file mode 100644 index 0000000..9bdafb2 --- /dev/null +++ b/additional/rootscl/etc/e-smith/templates/etc/my.conf/_VER_-09socket @@ -0,0 +1,5 @@ +socket=/var/lib/mysql/mariadb!!!VER!!!.sock +{ + my $localonly = ${'mariadb!!!VER!!!-mariadb'}{'LocalNetworkingOnly'} || "no"; + $OUT = ($localonly eq 'yes') ? "skip-networking" : "skip-networking=0\n# networking is enabled"; +} diff --git a/additional/rootscl/etc/e-smith/templates/etc/my.conf/_VER_-10port b/additional/rootscl/etc/e-smith/templates/etc/my.conf/_VER_-10port new file mode 100644 index 0000000..fb2b045 --- /dev/null +++ b/additional/rootscl/etc/e-smith/templates/etc/my.conf/_VER_-10port @@ -0,0 +1,7 @@ +{ + $OUT = ""; + my $localonly = ${'mariadb!!!VER!!!-mariadb'}{'LocalNetworkingOnly'} || "no"; + # define port + my $port = ${'mariadb!!!VER!!!-mariadb'}{'port'} || "!!!PORT!!!"; + $OUT .= ($localonly eq 'yes') ? "#no port as skip-networking\n" : "port=$port\n"; +} diff --git a/additional/rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql_VER_ b/additional/rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql_VER_ new file mode 100644 index 0000000..fa9e769 --- /dev/null +++ b/additional/rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql_VER_ @@ -0,0 +1,84 @@ +/* Server Mariadb !!!VER!!! localhost (config:root) [1] */ +$i++; +$cfg['Servers'][$i]['host'] = 'localhost'; +$cfg['Servers'][$i]['extension'] = 'mysqli'; +$cfg['Servers'][$i]['connect_type'] = 'socket'; +$cfg['Servers'][$i]['socket'] = '!!!SOCKET!!!'; +$cfg['Servers'][$i]['compress'] = false; +# standalone or login mode +$scriptname=end(explode('/',$_SERVER['PHP_SELF'])); +$scriptpath=str_replace($scriptname,"",$_SERVER['PHP_SELF']); +# standalone login part +{ +my $adminaccess = ($phpmyadmin{'adminaccess'} || 'enabled'); +my $multiaccess = ($phpmyadmin{'multiaccess'} || 'disabled'); +if (("$adminaccess" eq "enabled")) + { + $OUT .="if (\$scriptpath==\"/phpmyadmin/\" && \$_SERVER['PHP_AUTH_USER']=='admin')\n"; + $OUT .="{\n"; + $OUT .="\$cfg['Servers'][\$i]['auth_type'] = 'config';\n"; + $OUT .="\$cfg['Servers'][\$i]['user'] = 'root';\n"; + open (PW, "/etc/openldap/ldap.pw") + || die "Could not read LDAP password.\n"; + my $pw = ; + chomp ($pw); + close PW; + $OUT .="\$cfg['Servers'][\$i]['password'] = '$pw';\n"; + $OUT .="}"; + } +else + { + $OUT .="# standelaone admin configuration disabled"; + } +} +# end of standalone login part +# multiuser login part +{ +my $adminaccess = ($phpmyadmin{'adminaccess'} || 'enabled'); +my $multiaccess = ($phpmyadmin{'multiaccess'} || 'disabled'); + $OUT .="\n"; +if (("$multiaccess" eq "enabled") && ("$adminaccess" eq "enabled")) + { + $OUT .="if (\$scriptpath==\"/phpmyadmin-multi/\")\n"; + $OUT .="{\n"; + } +if (("$multiaccess" eq "enabled")) + { + $OUT .="\$cfg['Servers'][\$i]['auth_type'] = 'cookie';\n"; + my $secret = ${'httpd-admin'}{TKTAuthSecret} || "34322500-7330-4400-423A-3A00434F5245"; + $OUT .="\$cfg['blowfish_secret'] = '$secret';\n"; + } +else + { + $OUT .="# multiuser disabled\n"; + } +if (("$multiaccess" eq "enabled") && ("$adminaccess" eq "enabled")) + { + $OUT .="}\n"; + } +} +# end of multiuser login part +$cfg['Servers'][$i]['controluser'] = ""; +$cfg['Servers'][$i]['controlpass'] = ""; +$cfg['Servers'][$i]['only_db'] = ""; +$cfg['Servers'][$i]['hide_db'] = ""; +$cfg['Servers'][$i]['verbose'] = 'Mariadb!!!VER!!!';// here is the name as it appears in phpmyadmin +$cfg['Servers'][$i]['pmadb'] = ""; +$cfg['Servers'][$i]['bookmarktable'] = ""; +$cfg['Servers'][$i]['relation'] = ""; +$cfg['Servers'][$i]['table_info'] = ""; +$cfg['Servers'][$i]['table_coords'] = ""; +$cfg['Servers'][$i]['pdf_pages'] = ""; +$cfg['Servers'][$i]['column_info'] = ""; +$cfg['Servers'][$i]['history'] = ""; +$cfg['Servers'][$i]['verbose_check'] = TRUE; +$cfg['Servers'][$i]['AllowRoot'] = TRUE; +$cfg['Servers'][$i]['AllowDeny']['order']=""; +$cfg['Servers'][$i]['AllowDeny']['rules']= array(); +$cfg['Servers'][$i]['AllowNoPassword']= FALSE; +$cfg['Servers'][$i]['designer_coords']= ""; +$cfg['Servers'][$i]['bs_garbage_threshold']= 50; +$cfg['Servers'][$i]['bs_repository_threshold']= '32M'; +$cfg['Servers'][$i]['bs_temp_blob_timeout']= 600; +$cfg['Servers'][$i]['bs_temp_log_threshold']= '32M'; + diff --git a/additional/rootscl/etc/logrotate.d/mariadb_VER_ b/additional/rootscl/etc/logrotate.d/mariadb_VER_ new file mode 100644 index 0000000..b8a40f1 --- /dev/null +++ b/additional/rootscl/etc/logrotate.d/mariadb_VER_ @@ -0,0 +1,17 @@ +/var/log/mariadb!!!VER!!!/*.log { + create 640 mysql mysql + notifempty + daily + rotate 7 + missingok + compress + postrotate + # just if mysqld is really running + if test -x /opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysqladmin && \ + /usr/bin/scl enable rh-mariadb!!!VER!!! -- /opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysqladmin --socket=!!!SOCKET!!! ping &>/dev/null + then + /usr/bin/scl enable rh-mariadb!!!VER!!! -- /opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysqladmin --socket=!!!SOCKET!!! --local flush-error-log \ + flush-engine-log flush-general-log flush-slow-log + fi + endscript +} diff --git a/additional/rootscl/sbin/e-smith/mariadb_VER_-preload b/additional/rootscl/sbin/e-smith/mariadb_VER_-preload new file mode 100644 index 0000000..85104c5 --- /dev/null +++ b/additional/rootscl/sbin/e-smith/mariadb_VER_-preload @@ -0,0 +1,61 @@ +#!/usr/bin/perl -w + +use strict; +use esmith::config; +use esmith::db; +use esmith::util; + +my %conf; +tie %conf, 'esmith::config'; + +my $event = $ARGV[0]; +my $file = $ARGV[1]; + +#--------------------------------------------------------------------------- +# Check the runlevel, if we're in runlevel 7, and we're being called from +# bootstrap-console-save, then MySQL can't be running, so use bootstrap mode. +# Otherwise, just use mysql to do a straight import. +#--------------------------------------------------------------------------- + +my $runlevel; + +open (RUNLEVEL, "-|", "/usr/bin/systemctl get-default"); +(undef, $runlevel) = split(' ',); +close RUNLEVEL; + + +if ( ($runlevel ne 'multi-user.target' && $runlevel ne "sme-server.target") || $event eq 'bootstrap-console-save') +{ + my $pid = open(KID, "|-"); + if (defined $pid) + { + if ($pid) + { + open(SQL, "<$file"); + print KID foreach (); + close SQL; + close(KID); + waitpid $pid,0; + } + else + { + # Find our mysqld binary + my $mysqld = "/opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysqld"; + if (-f "/opt/rh/rh-mariadb!!!VER!!!/root/usr/sbin/mysqld") { + $mysqld = "/opt/rh/rh-mariadb!!!VER!!!/root/usr/sbin/mysqld"; + } + # Hard-code user, since it is set in mysqld_safe currently. + # See http://bugs.mysql.com/2163 + exec("/usr/bin/scl enable rh-mariadb!!!VER!!! -- $mysqld", qw(--bootstrap --user=mysql --skip-grant-tables)); + } + } + else + { + warn "Couldn't fork: $!"; + } +} +else +{ + system("/usr/bin/scl enable rh-mariadb!!!VER!!! -- /opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysql < $file"); +} +exit(0); diff --git a/additional/rootscl/sbin/e-smith/systemd/mariadb_VER_-initialize b/additional/rootscl/sbin/e-smith/systemd/mariadb_VER_-initialize new file mode 100755 index 0000000..c8eff13 --- /dev/null +++ b/additional/rootscl/sbin/e-smith/systemd/mariadb_VER_-initialize @@ -0,0 +1,58 @@ +#!/bin/bash +datadir="/var/opt/rh/rh-mariadb!!!VER!!!/lib/mysql" + +# We have to re-enable SCL environment, because /sbin/service +# clears almost all environment variables. +# Since X_SCLS is cleared as well, we lose information about other +# collections enabled. +. /opt/rh/rh-mariadb!!!VER!!!/service-environment +for sclname in $RH_MARIADB!!!VER!!!_SCLS_ENABLED ; do + . /opt/rh/$sclname/enable + export X_SCLS="$X_SCLS $sclname" +done + +# we want start daemon only inside "scl enable" invocation +if ! scl_enabled $sclname ; then + echo "Collection $sclname has to be listed in /opt/rh/rh-mariadb!!!VER!!!/service-environment" + exit 1 +fi + +if [ ! -f $datadir/mysql/user.frm ] +then + touch /var/log/mariadb!!!VER!!!/mariadb.log + chown mysql:mysql /var/log/mariadb!!!VER!!!/mariadb.log + chmod 0640 /var/log/mariadb!!!VER!!!/mariadb.log + echo "Initializing mariadb!!!VER!!! database" + /opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysql-prepare-db-dir + ret=$? + if [ $ret -ne 0 ] ; then + echo "Initialization of MySQL database failed." >&2 + echo "Perhaps /etc/opt/rh/rh-mariadb!!!VER!!!/my.cnf is misconfigured." >&2 + # Clean up any partially-created database files + if [ ! -e "$datadir/mysql/user.frm" ] ; then + rm -rf "$datadir"/* + fi + exit $ret + fi + # set root password , 104 and above have a different syntax and allow root passwordless access + if [ !!!VER!!! -le 103 ] + then + /opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysqld --bootstrap --datadir="$datadir" --user="mysql" < /var/lib/mysql/set.password2 + fi + # upgrade does not need to be run on a fresh datadir + #echo "5.7.24" >"$datadir/mysql_upgrade_info" + # In case we're running as root, make sure files are owned properly + chown -R "mysql:mysql" "$datadir" + + if [ -f /home/e-smith/db/mariadb!!!VER!!!/mysql.dump ] + then + /sbin/e-smith/expand-template /etc/e-smith/sql/init!!!VER!!!/00_restore_dumped_dbs + fi +else + # else we set root password anyway ! just to be sure ! 104 and above have a different syntax and allow root passwordless access + if [ !!!VER!!! -le 103 ] + then + /opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysqld --bootstrap --datadir="$datadir" --user="mysql" < /var/lib/mysql/set.password2 + fi + exit 0 +fi diff --git a/additional/rootscl/sbin/e-smith/systemd/mariadb_VER_-mysql.init b/additional/rootscl/sbin/e-smith/systemd/mariadb_VER_-mysql.init new file mode 100755 index 0000000..131e110 --- /dev/null +++ b/additional/rootscl/sbin/e-smith/systemd/mariadb_VER_-mysql.init @@ -0,0 +1,82 @@ +#!/bin/sh + +#---------------------------------------------------------------------- +# copyright (C) 2022 Koozali Foundation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Technical support for this program is available from Mitel Networks +# Please visit our web site www.mitel.com/sme/ for details. +#---------------------------------------------------------------------- + +# We have to re-enable SCL environment, because /sbin/service +# clears almost all environment variables. +# Since X_SCLS is cleared as well, we lose information about other +# collections enabled. +. /opt/rh/rh-mariadb!!!VER!!!/service-environment +for sclname in $RH_MARIADB!!!VER!!!_SCLS_ENABLED ; do + . /opt/rh/$sclname/enable + export X_SCLS="$X_SCLS $sclname" +done + +# we want start daemon only inside "scl enable" invocation +if ! scl_enabled $sclname ; then + echo "Collection $sclname has to be listed in /opt/rh/rh-mariadb!!!VER!!!/service-environment" + exit 1 +fi + + +# Source function library. +. /etc/rc.d/init.d/functions + +if [ $# -lt 1 ]; then + echo "Usage: $0 " 1>&2 + exit 1 +fi +# We should only do something if $1 is 'start'. +if [ $1 != "start" ] && [ $1 != "restart" ]; then + exit 0 +fi + +for i in $(seq 1 10) +do + if test -e !!!SOCKET!!! + then + exit_value=0 + HOME=/root + export HOME + for link in $(find /etc/e-smith/sql/init!!!VER!!! -type f -o -type l | sort) + do + F=$(basename $link | sed s/S[0-9][0-9]//) + case $F in + *.sql) + action "Loading $F into mariadb !!!VER!!!" /opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysql --socket=!!!SOCKET!!! < $link && /bin/rm $link + ;; + *) + action "Loading $F into mariadb !!!VER!!!" $link && /bin/rm $link + ;; + esac + # Record any failure for the final return value. + if [ $? -ne 0 ]; then + exit_value=1 + fi + done + exit $exit_value + fi + echo "Waiting for mysql to startup" >&2 + sleep 2 +done + +exit 1 diff --git a/additional/rootscl/sbin/e-smith/systemd/mariadb_VER_-post b/additional/rootscl/sbin/e-smith/systemd/mariadb_VER_-post new file mode 100644 index 0000000..8524c38 --- /dev/null +++ b/additional/rootscl/sbin/e-smith/systemd/mariadb_VER_-post @@ -0,0 +1,18 @@ +#!/bin/bash + +for i in $(seq 1 20); +do + if [ -S !!!SOCKET!!! ] + then + /usr/bin/mysql!!!VER!!! < /var/lib/mysql/set.password2 + echo "root password set" + exit 0 + fi + echo waiting for rh-mariadb105-mariadb to start to set root password + sleep 1 +done +echo failed to set root password +# we fail silently, mariadb will still work, only issue is for phpmyadmin +# and non socket access +exit 0 + diff --git a/additional/rootscl/usr/lib/systemd/system/mariadb_VER_-mariadb.service b/additional/rootscl/usr/lib/systemd/system/mariadb_VER_-mariadb.service new file mode 100644 index 0000000..d28f2a9 --- /dev/null +++ b/additional/rootscl/usr/lib/systemd/system/mariadb_VER_-mariadb.service @@ -0,0 +1,53 @@ +[Unit] +Description=Mariadb !!!VER!!! database server +After=syslog.target +After=network.target + +[Service] +Type=simple +User=root +Group=root +PIDFile=/var/run/rh-mariadb!!!VER!!!-mariadb/mariadb.pid + +# Load collections set to enabled for this service +EnvironmentFile=/opt/rh/rh-mariadb!!!VER!!!/service-environment + +#ours : we need root user as + and ! are not yet supported +ExecStartPre=-/sbin/e-smith/service-status mariadb!!!VER!!!-mariadb +ExecStartPre=-/sbin/e-smith/expand-template /var/lib/mysql/set.password +ExecStartPre=-/sbin/e-smith/expand-template /root/.my.cnf +ExecStartPre=-/sbin/e-smith/expand-template /etc/my.cnf +ExecStartPre=-/sbin/e-smith/expand-template /etc/opt/rh/rh-mariadb!!!VER!!!/my.cnf +ExecStartPre=/sbin/e-smith/systemd/mariadb!!!VER!!!-initialize + +# We want to start server only inside "scl enable" invocation +ExecStartPre=/usr/bin/scl enable $RH_MARIADB!!!VER!!!_SCLS_ENABLED -- /usr/bin/scl_enabled rh-mariadb!!!VER!!! +ExecStartPre=/usr/bin/scl enable $RH_MARIADB!!!VER!!!_SCLS_ENABLED -- /opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysql-check-socket +ExecStartPre=/usr/bin/scl enable $RH_MARIADB!!!VER!!!_SCLS_ENABLED -- /opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysql-prepare-db-dir %n + +# Note: we set --basedir to prevent probes that might trigger SELinux alarms, +# per bug #547485 +ExecStart=/opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysqld_safe-scl-helper enable $RH_MARIADB!!!VER!!!_SCLS_ENABLED -- /opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysqld \ + --defaults-file=/etc/my.cnf \ + --datadir=/var/opt/rh/rh-mariadb!!!VER!!!/lib/mysql \ + --user=mysql \ + --basedir=/opt/rh/rh-mariadb!!!VER!!!/root/usr \ + --pid-file=/var/run/rh-mariadb!!!VER!!!-mariadb/mariadb.pid + +ExecStartPost=/usr/bin/scl enable $RH_MARIADB!!!VER!!!_SCLS_ENABLED -- /opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysql-check-upgrade +ExecStopPost=/usr/bin/scl enable $RH_MARIADB!!!VER!!!_SCLS_ENABLED -- /opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysql-wait-stop + +#ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID + +# Give a reasonable amount of time for the server to start up/shut down +TimeoutSec=300 + +# Place temp files in a secure directory, not /tmp +PrivateTmp=true + +Restart=on-failure + +RestartPreventExitStatus=1 + +[Install] +WantedBy=sme-server.target diff --git a/additional/rootscl/usr/lib/systemd/system/mariadb_VER_-mysql.init.service b/additional/rootscl/usr/lib/systemd/system/mariadb_VER_-mysql.init.service new file mode 100644 index 0000000..0126e39 --- /dev/null +++ b/additional/rootscl/usr/lib/systemd/system/mariadb_VER_-mysql.init.service @@ -0,0 +1,20 @@ +[Unit] +SourcePath=/sbin/e-smith/systemd/mariadb!!!VER!!!-mysql.init +Description=Koozali SME Server mysql DB injector for mariadb!!!VER!!! +After=mariadb!!!VER!!!-mariadb.service +Requires=mariadb!!!VER!!!-mariadb.service + +[Service] +Type=oneshot +Restart=no +TimeoutSec=10min +IgnoreSIGPIPE=no +KillMode=process +GuessMainPID=no +RemainAfterExit=yes +ExecStart=/sbin/e-smith/systemd/mariadb!!!VER!!!-mysql.init start +ExecStop=/sbin/e-smith/systemd/mariadb!!!VER!!!-mysql.init stop + +[Install] +WantedBy=sme-server.target + diff --git a/contriborbase b/contriborbase new file mode 100644 index 0000000..ef36a67 --- /dev/null +++ b/contriborbase @@ -0,0 +1 @@ +sme10 diff --git a/createlinks b/createlinks new file mode 100755 index 0000000..10d530e --- /dev/null +++ b/createlinks @@ -0,0 +1,131 @@ +#!/usr/bin/perl -w + +use esmith::Build::CreateLinks qw(:all); +my @versions = ( 101, 102, 103, 105); + +#-------------------------------------------------- +# pre-backup actions +#-------------------------------------------------- +my $event = "pre-backup"; + +event_link("mysql-delete-dumped-tables", $event, "10"); +event_link("mysql-dump-tables", $event, "20"); + +foreach ( @versions) +{ + event_link("mariadb$_-delete-dumped-tables", $event, "10"); + event_link("mariadb$_-dump-tables", $event, "20"); +} + +#-------------------------------------------------- +# post-backup actions +#-------------------------------------------------- +$event = "post-backup"; + +# Probably don't really need to do this +event_link("mysql-delete-dumped-tables", $event, "10"); + +foreach ( @versions) +{ + event_link("mariadb$_-delete-dumped-tables", $event, "10"); +} + + +# When we do a restore, we want to start from a completely clean slate +$event = "pre-restore"; + +safe_symlink("stop", "root/etc/e-smith/events/$event/services2adjust/mariadb"); +# Needs to be after shutdown of mysqld +event_link("mysql-delete-db-files", $event, "99"); + +foreach ( @versions) +{ + safe_symlink("stop", "root$_/etc/e-smith/events/$event/services2adjust/mariadb$_-mariadb"); + event_link("mariadb$_-delete-db-files", $event, "99"); +} + + +#-------------------------------------------------- +# actions for bootstrap-console-save event +#-------------------------------------------------- +$event = "bootstrap-console-save"; + +foreach (qw( + /etc/my.cnf + /root/.my.cnf + /var/lib/mysql/set.password + )) +{ + templates2events("$_", $event); +} + +# Move all database dumps except for mysql.dump to sql/init +event_link("mysql-load-tables", $event, "40"); +templates2events("/etc/e-smith/sql/init/10mysql_upgrade", $event); + + +foreach ( @versions) +{ + templates2events("/etc/opt/rh/rh-mariadb$_/my.cnf", $event); + templates2events("/etc/e-smith/sql/init$_/10mysql_upgrade", $event); + event_link("mariadb$_-load-tables", $event, "40"); +} + +#-------------------------------------------------- +# actions for timezone-update event +#-------------------------------------------------- +$event = "timezone-update"; + +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mariadb"); + +foreach ( @versions) +{ + safe_symlink("restart", "root$_/etc/e-smith/events/$event/services2adjust/mariadb$_-mariadb"); +} + +#-------------------------------------------------- +# actions for smeserver-mysql-update event +#-------------------------------------------------- +$event = "smeserver-mysql-update"; + +foreach (qw( + /etc/my.cnf + /root/.my.cnf + /var/lib/mysql/set.password + )) +{ + templates2events("$_", $event); +} + +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mariadb"); +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mysql.init"); +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyslog"); +# Move all database dumps except for mysql.dump to sql/init +event_link("mysql-load-tables", $event, "40"); +templates2events("/etc/e-smith/sql/init/10mysql_upgrade", $event); +templates2events("/etc/rsyslog.conf", $event); + +# systemd-specific action mandatory for this package-update event +event_link("systemd-reload", $event, "89"); +event_link("systemd-default", $event, "88"); + +foreach ( @versions) +{ +$event = "smeserver-mariadb$_-update"; +templates2events("/etc/my.cnf", $event); +templates2events("/root/.my.cnf", $event); +templates2events("/var/lib/mysql/set.password", $event); +templates2events("/var/lib/mysql/set.password2", $event); +templates2events("/etc/phpMyAdmin/config.inc.php", $event); +templates2events("/etc/opt/rh/rh-mariadb$_/my.cnf", $event); +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mariadb$_-mariadb"); +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mariadb$_-mysql.init"); +event_link("mariadb$_-load-tables", $event, "40"); +templates2events("/etc/e-smith/sql/init$_/10mysql_upgrade", $event); + +# systemd-specific action mandatory for this package-update event +event_link("systemd-reload", $event, "89"); +event_link("systemd-default", $event, "88"); +} + + diff --git a/root/etc/e-smith/db/configuration/defaults/mariadb/LocalNetworkingOnly b/root/etc/e-smith/db/configuration/defaults/mariadb/LocalNetworkingOnly new file mode 100644 index 0000000..7cfab5b --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/mariadb/LocalNetworkingOnly @@ -0,0 +1 @@ +yes diff --git a/root/etc/e-smith/db/configuration/defaults/mariadb/status b/root/etc/e-smith/db/configuration/defaults/mariadb/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/mariadb/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/mariadb/type b/root/etc/e-smith/db/configuration/defaults/mariadb/type new file mode 100644 index 0000000..24e1098 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/mariadb/type @@ -0,0 +1 @@ +service diff --git a/root/etc/e-smith/db/configuration/defaults/mysql.init/status b/root/etc/e-smith/db/configuration/defaults/mysql.init/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/mysql.init/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/mysql.init/type b/root/etc/e-smith/db/configuration/defaults/mysql.init/type new file mode 100644 index 0000000..24e1098 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/mysql.init/type @@ -0,0 +1 @@ +service diff --git a/root/etc/e-smith/db/configuration/migrate/00mysqld2mariadb b/root/etc/e-smith/db/configuration/migrate/00mysqld2mariadb new file mode 100644 index 0000000..d21ab7a --- /dev/null +++ b/root/etc/e-smith/db/configuration/migrate/00mysqld2mariadb @@ -0,0 +1,11 @@ +{ + # Rename mysqld service entry to mariadb + + my $mysqld = $DB->get('mysqld') or return; + my $mariadb = $DB->get('mariadb') || + $DB->new_record('mariadb', { type => 'service' }); + + $mariadb->merge_props($mysqld->props); + $mysqld->delete; + +} diff --git a/root/etc/e-smith/db/configuration/migrate/15innodb b/root/etc/e-smith/db/configuration/migrate/15innodb new file mode 100644 index 0000000..8191953 --- /dev/null +++ b/root/etc/e-smith/db/configuration/migrate/15innodb @@ -0,0 +1,6 @@ +{ + # InnoDB is mandatory with mariadb + my $a = $DB->get("mariadb") or return; + return unless (exists $mariadb{'InnoDB'}); + $DB->get_prop_and_delete('mariadb', 'InnoDB'); +} diff --git a/root/etc/e-smith/events/actions/mysql-delete-db-files b/root/etc/e-smith/events/actions/mysql-delete-db-files new file mode 100644 index 0000000..f41e3db --- /dev/null +++ b/root/etc/e-smith/events/actions/mysql-delete-db-files @@ -0,0 +1,3 @@ +#! /bin/sh + +cd /var/lib/mysql && find . -type f | xargs rm -f diff --git a/root/etc/e-smith/events/actions/mysql-delete-dumped-tables b/root/etc/e-smith/events/actions/mysql-delete-dumped-tables new file mode 100644 index 0000000..684690f --- /dev/null +++ b/root/etc/e-smith/events/actions/mysql-delete-dumped-tables @@ -0,0 +1,3 @@ +#!/bin/sh + +exec /bin/rm -f /home/e-smith/db/mysql/*.dump diff --git a/root/etc/e-smith/events/actions/mysql-dump-tables b/root/etc/e-smith/events/actions/mysql-dump-tables new file mode 100644 index 0000000..74b2b0c --- /dev/null +++ b/root/etc/e-smith/events/actions/mysql-dump-tables @@ -0,0 +1,41 @@ +#!/bin/sh + +status=$(/sbin/e-smith/config getprop mariadb status) +fixtables=$(/sbin/e-smith/config getprop mariadb autofixtables || echo "disabled") +if [ "$fixtables" = "enabled" ]; then + /sbin/e-smith/config delprop mariadb failsbackup +fi +failsbackup=$(/sbin/e-smith/config getprop mariadb failsbackup || echo "disabled") + + +onfailure () { + db=$1 + message="" + if [ "$failsbackup" = "enabled" ]; then + exit 1; + message="There was an error trying to dump database $db, please fix this db. We stop there without backups." + echo $message + echo $message | /usr/bin/mail -s "error on backup of $db MariaDB database" admin + fi + message="$message \nThere was an error trying to dump database $db, please check for table errors in this db. Forcing a backup of the corrupted DB." + mysqldump --force --ignore-table=mysql.event --single-transaction --add-drop-table -QB "$db" -r /home/e-smith/db/mysql/"$db"-failed.dump || message="$message \nFailed to force backup of corrupted db $db as $db-failed.dump" >&2 + if [ "$fixtables" = "enabled" ]; then + repair="failure" + message="$message \nTrying to auto-repair the db and do a backup after..." + mysqlcheck -s --auto-repair -c "$db" && \ + mysqldump --ignore-table=mysql.event --single-transaction --add-drop-table -QB "$db" -r /home/e-smith/db/mysql/"$db".dump && repair="success" + message="$message \n => $repair" + fi + echo $message + echo $message | /usr/bin/mail -s "error on backup of $db MariaDB database" admin +} + +if [ "$status" = "disabled" ] +then + echo "mysqld is disabled - no tables dumped" >&2 + exit 0 +fi +for db in $(mysql -BNre "show databases;"|egrep -vi "^information_schema$|^performance_schema$") +do + mysqldump --ignore-table=mysql.event --single-transaction --add-drop-table -QB "$db" -r /home/e-smith/db/mysql/"$db".dump || onfailure $db +done diff --git a/root/etc/e-smith/events/actions/mysql-load-tables b/root/etc/e-smith/events/actions/mysql-load-tables new file mode 100644 index 0000000..e225199 --- /dev/null +++ b/root/etc/e-smith/events/actions/mysql-load-tables @@ -0,0 +1,17 @@ +#!/bin/sh + +status=$(/sbin/e-smith/config getprop mariadb status) +if [ "$status" = "disabled" ] +then + echo "mysqld is disabled - no tables restored" >&2 + exit 0 +fi +/bin/rm -f /home/e-smith/db/mysql/information_schema.dump +/bin/rm -f /home/e-smith/db/mysql/performance_schema.dump +if [ ! -f /var/lib/mysql/mysql/user.frm ] +then + for db in $(ls /home/e-smith/db/mysql/*.dump 2> /dev/null | grep -v '/mysql.dump') + do + mv $db /etc/e-smith/sql/init/01_$(basename $db .dump).sql + done +fi diff --git a/root/etc/e-smith/sql/init/.gitignore b/root/etc/e-smith/sql/init/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/00_restore_dumped_dbs b/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/00_restore_dumped_dbs new file mode 100644 index 0000000..6a29f37 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/00_restore_dumped_dbs @@ -0,0 +1 @@ +PERMS=0540 diff --git a/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/10mysql_upgrade b/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/10mysql_upgrade new file mode 100644 index 0000000..6a29f37 --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/10mysql_upgrade @@ -0,0 +1 @@ +PERMS=0540 diff --git a/root/etc/e-smith/templates.metadata/var/lib/mysql/set.password b/root/etc/e-smith/templates.metadata/var/lib/mysql/set.password new file mode 100644 index 0000000..b3161cf --- /dev/null +++ b/root/etc/e-smith/templates.metadata/var/lib/mysql/set.password @@ -0,0 +1,3 @@ +PERMS=0400 +UID="root" +GID="root" diff --git a/root/etc/e-smith/templates.metadata/var/lib/mysql/set.password2 b/root/etc/e-smith/templates.metadata/var/lib/mysql/set.password2 new file mode 100644 index 0000000..b3161cf --- /dev/null +++ b/root/etc/e-smith/templates.metadata/var/lib/mysql/set.password2 @@ -0,0 +1,3 @@ +PERMS=0400 +UID="root" +GID="root" diff --git a/root/etc/e-smith/templates/etc/e-smith/sql/init/00_restore_dumped_dbs b/root/etc/e-smith/templates/etc/e-smith/sql/init/00_restore_dumped_dbs new file mode 100644 index 0000000..1328b2b --- /dev/null +++ b/root/etc/e-smith/templates/etc/e-smith/sql/init/00_restore_dumped_dbs @@ -0,0 +1,19 @@ +#! /bin/sh + +( cat /home/e-smith/db/mysql/mysql.dump ; + cat /var/lib/mysql/set.password ) | mysql || exit 1 +/usr/bin/mysql_upgrade +/bin/rm /var/run/mariadb/mariadb.pid +/usr/bin/systemctl restart mariadb.service +for i in $(seq 1 20); +do + if [ -f /var/run/mariadb/mariadb.pid ] + then + /bin/rm /home/e-smith/db/mysql/mysql.dump + exit 0 + fi + echo waiting for mysqld to restart + sleep 1 +done +echo mysqld failed to restart +exit 1 diff --git a/root/etc/e-smith/templates/etc/e-smith/sql/init/10mysql_upgrade b/root/etc/e-smith/templates/etc/e-smith/sql/init/10mysql_upgrade new file mode 100644 index 0000000..3da5e80 --- /dev/null +++ b/root/etc/e-smith/templates/etc/e-smith/sql/init/10mysql_upgrade @@ -0,0 +1,16 @@ +#!/bin/sh +/usr/bin/mysql_upgrade + +/bin/rm /var/run/mariadb/mariadb.pid +/usr/bin/systemctl restart mariadb.service +for i in $(seq 1 20); +do + if [ -f /var/run/mariadb/mariadb.pid ] + then + exit 0 + fi + echo waiting for mysqld to restart + sleep 1 +done +echo mysqld failed to restart +exit 1 diff --git a/root/etc/e-smith/templates/etc/my.cnf/000readme b/root/etc/e-smith/templates/etc/my.cnf/000readme new file mode 100644 index 0000000..8dda51f --- /dev/null +++ b/root/etc/e-smith/templates/etc/my.cnf/000readme @@ -0,0 +1,33 @@ +########################################################### +# Here is a cheat-sheet for this file as of MySQL 4.0.14 +# 2003-12-18 - tony_clayton@mitel.com +# +# 1. The mysqld binary reads options from the [mysqld] section, +# and then overrides those values with any passed-in +# arguments. +# +# 2. The mysqld_safe script reads options from the following +# sections in order, overriding any previous values with newer +# ones: +# [mysqld] [server] [mysqld_safe] [safe_mysqld] +# It then overrides those values with any passed-in +# arguments, and invokes the mysqld binary (see #1 above) with +# the resulting argument list. +# +# * The server and safe_mysqld sections are deprecated in +# favour of mysqld and mysqld_safe respectively. +# +# 3. The mysql or mysqld initscript reads options from the +# following sections in order, overriding any previous values +# with newer ones: +# [mysqld] [mysql_server] [mysql.server] +# It then overrides those values with any passed-in arguments, +# and invokes the mysqld_safe script (see #2 above) with the +# resulting argument list. +# +# * The SMEServer doesn't have any need for initscript-only +# options, so we don't use mysql_server and mysql.server +# sections. +# +########################################################### + diff --git a/root/etc/e-smith/templates/etc/my.cnf/005mysqld b/root/etc/e-smith/templates/etc/my.cnf/005mysqld new file mode 100644 index 0000000..6423dab --- /dev/null +++ b/root/etc/e-smith/templates/etc/my.cnf/005mysqld @@ -0,0 +1 @@ +[mysqld] diff --git a/root/etc/e-smith/templates/etc/my.cnf/006pid-file b/root/etc/e-smith/templates/etc/my.cnf/006pid-file new file mode 100644 index 0000000..83bbe9e --- /dev/null +++ b/root/etc/e-smith/templates/etc/my.cnf/006pid-file @@ -0,0 +1 @@ +pid-file=/var/run/mariadb/mariadb.pid diff --git a/root/etc/e-smith/templates/etc/my.cnf/007basedir b/root/etc/e-smith/templates/etc/my.cnf/007basedir new file mode 100644 index 0000000..0dbe3af --- /dev/null +++ b/root/etc/e-smith/templates/etc/my.cnf/007basedir @@ -0,0 +1 @@ +basedir=/usr diff --git a/root/etc/e-smith/templates/etc/my.cnf/008datadir b/root/etc/e-smith/templates/etc/my.cnf/008datadir new file mode 100644 index 0000000..3f24e70 --- /dev/null +++ b/root/etc/e-smith/templates/etc/my.cnf/008datadir @@ -0,0 +1 @@ +datadir=/var/lib/mysql diff --git a/root/etc/e-smith/templates/etc/my.cnf/009innodb b/root/etc/e-smith/templates/etc/my.cnf/009innodb new file mode 100644 index 0000000..c00045d --- /dev/null +++ b/root/etc/e-smith/templates/etc/my.cnf/009innodb @@ -0,0 +1,14 @@ + +#innodb +{# https://mariadb.com/kb/en/innodb-system-variables/#innodb_large_prefix +#default Off up to 10.2.1 +# removed in 10.3.1 and 10.6.0 +# keep it there up to 10.2.2 +}innodb_large_prefix=1 +{#https://mariadb.com/kb/en/innodb-system-variables/#innodb_file_format +# default is antelope up to 10.2.1 +# keep it up to 10.2.2 +}innodb_file_format={ $mariadb{'innodb_file_format'}||'barracuda' } +{# enabled is already the default +}innodb_file_per_table={ $mariadb{'innodb_file_per_table'}||'1' } + diff --git a/root/etc/e-smith/templates/etc/my.cnf/009socket b/root/etc/e-smith/templates/etc/my.cnf/009socket new file mode 100644 index 0000000..580595e --- /dev/null +++ b/root/etc/e-smith/templates/etc/my.cnf/009socket @@ -0,0 +1,5 @@ +socket=/var/lib/mysql/mysql.sock +{ + my $localonly = $mariadb{LocalNetworkingOnly} || "no"; + $OUT = ($localonly eq 'yes') ? "skip-networking" : "# networking is enabled"; +} diff --git a/root/etc/e-smith/templates/etc/my.cnf/011user b/root/etc/e-smith/templates/etc/my.cnf/011user new file mode 100644 index 0000000..d2ef4ef --- /dev/null +++ b/root/etc/e-smith/templates/etc/my.cnf/011user @@ -0,0 +1 @@ +user=mysql diff --git a/root/etc/e-smith/templates/etc/my.cnf/012open_files_limit b/root/etc/e-smith/templates/etc/my.cnf/012open_files_limit new file mode 100644 index 0000000..78901eb --- /dev/null +++ b/root/etc/e-smith/templates/etc/my.cnf/012open_files_limit @@ -0,0 +1,9 @@ +{ + $OUT = ''; + # changed 0 to 32186 for mariadb 5.5 see BZ 12417 + my $limit = ${'mariadb'}{OpenFilesLimit} || 32186; + return if $limit eq 0; + + $OUT .= "open_files_limit=$limit\n"; + +} diff --git a/root/etc/e-smith/templates/etc/my.cnf/014server_system_variables b/root/etc/e-smith/templates/etc/my.cnf/014server_system_variables new file mode 100644 index 0000000..09fdc90 --- /dev/null +++ b/root/etc/e-smith/templates/etc/my.cnf/014server_system_variables @@ -0,0 +1,90 @@ +{ + $OUT = ''; + my $var; + $var = ${'mariadb'}{'MaxConnections'} || undef; + #default 151; range 10 to 100000 + $OUT .= "max_connections=$var\n" if defined $var; + + $var = ${'mariadb'}{'WaitTimeout'} || undef; + #default 28800 + $OUT .= "wait_timeout=$var\n" if defined $var; + + $var = ${'mariadb'}{'QueryCacheLimit'} || undef; + #default 1048576 (1M) + $OUT .= "query_cache_limit=$var\n" if defined $var; + + $var = ${'mariadb'}{'QueryCacheSize'} || '1M'; + #default 1048576 (1M) + $OUT .= "query_cache_size=$var\n" if defined $var; + + $var = ${'mariadb'}{'QueryCacheType'} || '1'; + #default 0 or OFF, 1 or ON, 2 or DEMAND + $OUT .= "query_cache_type=$var\n" if defined $var; + + $var = ${'mariadb'}{'SortBufferSize'} || undef; + #default 2M + $OUT .= "sort_buffer_size=$var\n" if defined $var; + + $var = ${'mariadb'}{'ReadRndBufferSize'} || undef; + #default 262144 from 8200 to 2147483647 + $OUT .= "read_rnd_buffer_size=$var\n" if defined $var; + + $var = ${'mariadb'}{'TableOpenCache'} || undef; + #default 400 (2000 sice 10.1.7) + $OUT .= "table_open_cache=$var\n" if defined $var; + + #Introduced: MariaDB 10.2.2 + #$var = ${'mariadb'}{'TableOpenCacheInstances'} || undef; + ##default 8 + #$OUT .= "table_open_cache_instances=$var\n" if defined $var; + + $var = ${'mariadb'}{'TmpTableSize'} || undef; + #default 16M + $OUT .= "tmp_table_size=$var\n" if defined $var; + + $var = ${'mariadb'}{'MaxHeapTableSize'} || undef; + #default 16M + $OUT .= "max_heap_table_size=$var\n" if defined $var; + + $var = ${'mariadb'}{'ThreadCacheSize'} || 256; + #default 0 from 0 to 16384 + $OUT .= "thread_cache_size=$var\n" if defined $var; + + $var = ${'mariadb'}{'KeyBufferSize'} || undef; + #default 134217728 - myisam only + $OUT .= "key_buffer_size=$var\n" if defined $var; + + $var = ${'mariadb'}{'MyisamSortBufferSize'} || undef; + #default 128M - before 10.0.3: 8M + $OUT .= "myisam_sort_buffer_size=$var\n" if defined $var; + + $var = ${'mariadb'}{'JoinBufferSize'} || 262144; + #default 262144 + $OUT .= "join_buffer_size=$var\n" if defined $var; + + $var = ${'mariadb'}{'ReadBufferSize'} || undef; + #default 131072 + $OUT .= "read_buffer_size=$var\n" if defined $var; + + $var = ${'mariadb'}{'ConnectTimeout'} || undef; + #default 10 + $OUT .= "connect_timeout=$var\n" if defined $var; + + $var = ${'mariadb'}{'MaxConnectErrors'} || 100; + #default 100 + $OUT .= "max_connect_errors=$var\n" if defined $var; + + $var = ${'mariadb'}{'MaxAllowedPacket'} || '16M'; + #default 4M + $OUT .= "max_allowed_packet=$var\n" if defined $var; + + $var = ${'mariadb'}{'SlowQueries'} ||undef; + if (defined $var) + { + $OUT .= "log_slow_queries=1\n"; # change to slow_query_log in mariadb 10.1 + $OUT .= "long_query_time=$var\n"; + $OUT .= "slow_query_log_file=\"/var/log/mariadb/slow_queries.log\"\n"; + } + +} + diff --git a/root/etc/e-smith/templates/etc/my.cnf/015logerror b/root/etc/e-smith/templates/etc/my.cnf/015logerror new file mode 100644 index 0000000..e6e5540 --- /dev/null +++ b/root/etc/e-smith/templates/etc/my.cnf/015logerror @@ -0,0 +1,3 @@ + +log_error=/var/log/mariadb/mariadb.log + diff --git a/root/etc/e-smith/templates/etc/my.cnf/040mysqld_safe b/root/etc/e-smith/templates/etc/my.cnf/040mysqld_safe new file mode 100644 index 0000000..2331b23 --- /dev/null +++ b/root/etc/e-smith/templates/etc/my.cnf/040mysqld_safe @@ -0,0 +1,4 @@ + +{ # allow backwards-compatibility with safe_mysqld (mysql < 4.0) + -f "/usr/bin/mysqld_safe" ? "[mysqld_safe]" : "[safe_mysqld]"; +} diff --git a/root/etc/e-smith/templates/etc/rsyslog.conf/32mysqlinit b/root/etc/e-smith/templates/etc/rsyslog.conf/32mysqlinit new file mode 100644 index 0000000..81474d5 --- /dev/null +++ b/root/etc/e-smith/templates/etc/rsyslog.conf/32mysqlinit @@ -0,0 +1,14 @@ +# *-mysql.init +:programname, isequal, "mysql.init" /var/log/mysql.init/mysql.init.log +& stop +:programname, isequal, "mariadb105-mysql.init" /var/log/mysql.init/mariadb105-mysql.init.log +& stop +:programname, isequal, "mariadb103-mysql.init" /var/log/mysql.init/mariadb103-mysql.init.log +& stop +:programname, isequal, "mariadb102-mysql.init" /var/log/mysql.init/mariadb102-mysql.init.log +& stop +:programname, isequal, "mariadb101-mysql.init" /var/log/mysql.init/mariadb101-mysql.init.log +& stop +:programname, isequal, "mysql57-mysql.init" /var/log/mysql.init/mysql57-mysql.init.log +& stop + diff --git a/root/etc/e-smith/templates/root/.my.cnf/50client b/root/etc/e-smith/templates/root/.my.cnf/50client new file mode 100644 index 0000000..bd651c4 --- /dev/null +++ b/root/etc/e-smith/templates/root/.my.cnf/50client @@ -0,0 +1 @@ +[client] diff --git a/root/etc/e-smith/templates/root/.my.cnf/55password b/root/etc/e-smith/templates/root/.my.cnf/55password new file mode 100644 index 0000000..a4f8a41 --- /dev/null +++ b/root/etc/e-smith/templates/root/.my.cnf/55password @@ -0,0 +1,9 @@ +{ + #---------------------------------------------------------- + # Read (and possibly create) DAP password + #---------------------------------------------------------- + + use esmith::util; + my $pw = esmith::util::LdapPassword; + $OUT .= "password=$pw"; +} diff --git a/root/etc/e-smith/templates/root/.my.cnf/template-begin b/root/etc/e-smith/templates/root/.my.cnf/template-begin new file mode 100644 index 0000000..6074514 --- /dev/null +++ b/root/etc/e-smith/templates/root/.my.cnf/template-begin @@ -0,0 +1,9 @@ +#------------------------------------------------------------ +# DO NOT MODIFY THIS FILE! It is updated automatically by the +# e-smith server and gateway software. Instead, modify the source +# template in the /etc/e-smith/templates directory. For more +# information, see http://www.e-smith.org. +# +# copyright (C) 1999-2001 e-smith, inc. +#------------------------------------------------------------ + diff --git a/root/etc/e-smith/templates/root/.my.cnf/template-end b/root/etc/e-smith/templates/root/.my.cnf/template-end new file mode 100644 index 0000000..2874297 --- /dev/null +++ b/root/etc/e-smith/templates/root/.my.cnf/template-end @@ -0,0 +1,4 @@ + +#------------------------------------------------------------ +# TEMPLATE END +#------------------------------------------------------------ diff --git a/root/etc/e-smith/templates/var/lib/mysql/set.password b/root/etc/e-smith/templates/var/lib/mysql/set.password new file mode 100644 index 0000000..886f47d --- /dev/null +++ b/root/etc/e-smith/templates/var/lib/mysql/set.password @@ -0,0 +1,12 @@ +{ + use esmith::util; + + my $pw = esmith::util::LdapPassword(); + + $OUT .= "use mysql;\n"; + $OUT .= "ALTER TABLE user MODIFY Password char(41) NOT NULL default '';\n"; + $OUT .= "UPDATE user SET password=password('$pw') WHERE user='root';\n"; + $OUT .= "DELETE FROM db WHERE user='';\n"; + $OUT .= "DELETE FROM user WHERE user='';\n"; + $OUT .= "FLUSH PRIVILEGES;\n"; +} diff --git a/root/etc/e-smith/templates/var/lib/mysql/set.password2 b/root/etc/e-smith/templates/var/lib/mysql/set.password2 new file mode 100644 index 0000000..897db0b --- /dev/null +++ b/root/etc/e-smith/templates/var/lib/mysql/set.password2 @@ -0,0 +1,9 @@ +{ + use esmith::util; + + my $pw = esmith::util::LdapPassword(); + + $OUT .= "use mysql;\n"; + $OUT .= "SET PASSWORD FOR 'root'\@localhost = PASSWORD(\"$pw\"); \n"; + $OUT .= "FLUSH PRIVILEGES;\n"; +} diff --git a/root/etc/logrotate.d/mariadb-sme b/root/etc/logrotate.d/mariadb-sme new file mode 100644 index 0000000..ba856f5 --- /dev/null +++ b/root/etc/logrotate.d/mariadb-sme @@ -0,0 +1,17 @@ +/var/log/mariadb/*.log { + create 640 mysql mysql + notifempty + daily + rotate 3 + missingok + compress + postrotate + # just if mysqld is really running + if test -x /usr/bin/mysqladmin && \ + /usr/bin/mysqladmin ping &>/dev/null + then + /usr/bin/mysqladmin flush-logs + fi + endscript +} + diff --git a/root/etc/logrotate.d/mysqlinit b/root/etc/logrotate.d/mysqlinit new file mode 100644 index 0000000..f722fb4 --- /dev/null +++ b/root/etc/logrotate.d/mysqlinit @@ -0,0 +1,9 @@ +/var/log/mysql.init/*.log { + create 640 root root + notifempty + daily + rotate 3 + missingok + compress +} + diff --git a/root/home/e-smith/db/mysql/.gitignore b/root/home/e-smith/db/mysql/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/root/sbin/e-smith/mysql-preload b/root/sbin/e-smith/mysql-preload new file mode 100644 index 0000000..2b34d67 --- /dev/null +++ b/root/sbin/e-smith/mysql-preload @@ -0,0 +1,61 @@ +#!/usr/bin/perl -w + +use strict; +use esmith::config; +use esmith::db; +use esmith::util; + +my %conf; +tie %conf, 'esmith::config'; + +my $event = $ARGV[0]; +my $file = $ARGV[1]; + +#--------------------------------------------------------------------------- +# Check the runlevel, if we're in runlevel 7, and we're being called from +# bootstrap-console-save, then MySQL can't be running, so use bootstrap mode. +# Otherwise, just use mysql to do a straight import. +#--------------------------------------------------------------------------- + +my $runlevel; + +open (RUNLEVEL, "-|", "/usr/bin/systemctl get-default"); +(undef, $runlevel) = split(' ',); +close RUNLEVEL; + + +if ( ($runlevel ne 'multi-user.target' && $runlevel ne "sme-server.target") || $event eq 'bootstrap-console-save') +{ + my $pid = open(KID, "|-"); + if (defined $pid) + { + if ($pid) + { + open(SQL, "<$file"); + print KID foreach (); + close SQL; + close(KID); + waitpid $pid,0; + } + else + { + # Find our mysqld binary + my $mysqld = "/usr/libexec/mysqld"; + if (-f "/usr/sbin/mysqld") { + $mysqld = "/usr/sbin/mysqld"; + } + # Hard-code user, since it is set in mysqld_safe currently. + # See http://bugs.mysql.com/2163 + exec($mysqld, qw(--bootstrap --user=mysql --skip-grant-tables)); + } + } + else + { + warn "Couldn't fork: $!"; + } +} +else +{ + system("/usr/bin/mysql < $file"); +} +exit(0); diff --git a/root/sbin/e-smith/systemd/mariadb-initialize b/root/sbin/e-smith/systemd/mariadb-initialize new file mode 100644 index 0000000..e5ebe8c --- /dev/null +++ b/root/sbin/e-smith/systemd/mariadb-initialize @@ -0,0 +1,14 @@ +#! /bin/sh + +exec 2>&1 +if [ ! -f /var/lib/mysql/mysql/user.frm ] +then + setuidgid mysql sh /usr/bin/mysql_install_db + /usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < /var/lib/mysql/set.password + if [ -f /home/e-smith/db/mysql/mysql.dump ] + then + /sbin/e-smith/expand-template /etc/e-smith/sql/init/00_restore_dumped_dbs + fi +else + /usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < /var/lib/mysql/set.password +fi diff --git a/root/sbin/e-smith/systemd/mysql.init b/root/sbin/e-smith/systemd/mysql.init new file mode 100644 index 0000000..79b7ec0 --- /dev/null +++ b/root/sbin/e-smith/systemd/mysql.init @@ -0,0 +1,72 @@ +#!/bin/sh + +#---------------------------------------------------------------------- +# copyright (C) 2002 Mitel Networks Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Technical support for this program is available from Mitel Networks +# Please visit our web site www.mitel.com/sme/ for details. +#---------------------------------------------------------------------- + +# Source function library. +SYSTEMCTL_SKIP_REDIRECT=1 +. /etc/rc.d/init.d/functions + +if [ $# -lt 1 ]; then + echo "Usage: $0 " 1>&2 + exit 1 +fi +# We should only do something if $1 is 'start'. +if [ $1 != "start" ] && [ $1 != "restart" ]; then + exit 0 +fi + +for i in $(seq 1 10) +do + if test -e /var/lib/mysql/mysql.sock + then + exit_value=0 + HOME=/root + export HOME + for link in $(find /etc/e-smith/sql/init -type f -o -type l | sort) + do + F=$(basename $link | sed 's/S\?[0-9][0-9]_\?//') + case $F in + *.sql) + action "Loading $F into mysql" perl -e ' + open (STDERR, "|/usr/bin/logger -p local1.info -t mysql.init"); + open (STDOUT, ">&STDERR"); + exec "/usr/bin/mysql";' < $link && /bin/rm $link + ;; + *) + action "Loading $F into mysql" perl -e ' + open (STDERR, "|/usr/bin/logger -p local1.info -t mysql.init"); + open (STDOUT, ">&STDERR"); + exec shift; ' $link && /bin/rm $link + ;; + esac + # Record any failure for the final return value. + if [ $? -ne 0 ]; then + exit_value=1 + fi + done + exit $exit_value + fi + echo "Waiting for mysql to startup" >&2 + sleep 2 +done + +exit 1 diff --git a/root/usr/lib/systemd/system/mariadb.service.d/50koozali.conf b/root/usr/lib/systemd/system/mariadb.service.d/50koozali.conf new file mode 100644 index 0000000..f417c10 --- /dev/null +++ b/root/usr/lib/systemd/system/mariadb.service.d/50koozali.conf @@ -0,0 +1,43 @@ +[Unit] +Description=MariaDB database server +After=syslog.target +After=network.target + +[Service] +Type=simple +User=root +Group=root + +#reset +ExecStartPre= +#ours : we need root user as + and ! are not yet supported +ExecStartPre=-/sbin/e-smith/service-status mariadb +ExecStartPre=-/sbin/e-smith/expand-template /var/lib/mysql/set.password +ExecStartPre=-/sbin/e-smith/expand-template /root/.my.cnf +ExecStartPre=-/sbin/e-smith/expand-template /etc/my.cnf +ExecStartPre=/sbin/e-smith/systemd/mariadb-initialize + +#reset +ExecStart= +#ours +ExecStart=/usr/libexec/mysqld \ + --defaults-file=/etc/my.cnf \ + --basedir=/usr \ + --datadir=/var/lib/mysql \ + --user=mysql \ + --pid-file=/var/run/mariadb/mariadb.pid + +#reset +ExecStartPost= +#ours +ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID + +# Give a reasonable amount of time for the server to start up/shut down +TimeoutSec=300 + +# Place temp files in a secure directory, not /tmp +PrivateTmp=true + +[Install] +WantedBy=sme-server.target + diff --git a/root/usr/lib/systemd/system/mysql.init.service b/root/usr/lib/systemd/system/mysql.init.service new file mode 100644 index 0000000..cb8c80d --- /dev/null +++ b/root/usr/lib/systemd/system/mysql.init.service @@ -0,0 +1,18 @@ +[Unit] +Description=Koozali SME Server mysql DB injector for mariadb +After=mariadb.service +Requires=mariadb.service + +[Service] +Type=oneshot +Restart=no +TimeoutSec=10min +IgnoreSIGPIPE=no +KillMode=process +GuessMainPID=no +RemainAfterExit=yes +ExecStart=/sbin/e-smith/systemd/mysql.init start +ExecStop=/sbin/e-smith/systemd/mysql.init stop + +[Install] +WantedBy=sme-server.target diff --git a/root/var/log/mariadb/.gitignore b/root/var/log/mariadb/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/smeserver-mysql.spec b/smeserver-mysql.spec new file mode 100644 index 0000000..4670c60 --- /dev/null +++ b/smeserver-mysql.spec @@ -0,0 +1,1176 @@ +Summary: Koozali SME Server specific mysql configuration and templates. +%define name smeserver-mysql +Name: %{name} +%define version 2.7.0 +%define release 19 +Version: %{version} +Release: %{release}%{?dist} +License: GPL +Group: Networking/Daemons +Source: %{name}-%{version}.tar.xz + +BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot +BuildArchitectures: noarch +Requires: mariadb-server +# mariadb after 5.5 /in Centos 8 will package mysql_upgrade in mariadb-server-utils +# Requires: /usr/bin/mysql_upgrade +Requires: mariadb +Requires: e-smith-base +Requires: e-smith-lib >= 1.15.1-19 +Provides: e-smith-mysql = 2.7.0 +Obsoletes: e-smith-mysql < 2.7.0 +BuildRequires: e-smith-devtools >= 1.13.1-03 +AutoReqProv: no + +%description +This package adds necessary startup and configuration items for +mysql. + + +%prep +%setup + +%build +for ver in 101 102 103 105 +do +mkdir root$ver +done +perl createlinks + +######################################### +# full job to create all needed version +######################################### +declare -A versions=([101]="10.1" [102]="10.2" [103]="10.3" [105]="10.5") +declare -A ports=([101]="3310" [102]="3311" [103]="3312" [105]="3313") + +for ver in 101 102 103 105 +do +##TODO seen those + +# default values from /etc/opt/rh/rh-mariadb101/my.cnf.d/mariadb-server.cnf +basedir="/opt/rh/rh-mariadb$ver/root/usr" +datadir="/var/opt/rh/rh-mariadb$ver/lib/mysql" +socket="/var/lib/mysql/mariadb$ver.sock" +logerror="/var//log/mariadb$ver/mariadb.log" +#"/var/opt/rh/rh-mariadb$ver/log/mariadb/mariadb.log" +pidfile="/var/run/rh-mariadb$ver-mariadb/mariadb.pid" +vers="${versions[$ver]}" +port="${ports[$ver]}" + +# we could choose to override /etc/opt/rh/rh-mariadb101/my.cnf or to force to share /etc/mariadb.log + +##Folders +mkdir -p root$ver/etc/e-smith/sql/init$ver +mkdir -p root$ver/home/e-smith/db/mariadb$ver +mkdir -p root$ver/var/log/mariadb$ver +#mkdir -p root$ver/home/e-smith/db/mysql/mariadb$ver +mkdir -p root$ver/etc/e-smith/events/actions + +# create configuration db default +#rm -rf etc/e-smith/db/configuration +mkdir -p root$ver/etc/e-smith/db/configuration/{defaults/mariadb$ver-mariadb,defaults/mariadb$ver-mysql.init,migrate} +echo "yes" > root$ver/etc/e-smith/db/configuration/defaults/mariadb$ver-mariadb/LocalNetworkingOnly +echo "enabled" > root$ver/etc/e-smith/db/configuration/defaults/mariadb$ver-mariadb/status +echo "service" > root$ver/etc/e-smith/db/configuration/defaults/mariadb$ver-mariadb/type +echo "enabled" > root$ver/etc/e-smith/db/configuration/defaults/mariadb$ver-mysql.init/status +echo "service" > root$ver/etc/e-smith/db/configuration/defaults/mariadb$ver-mysql.init/type + +# create templates.metadata +## for /etc/e-smith/templates/etc/my.cnf/ => /etc/opt/rh/rh-mariadb$ver/my.cnf +mkdir -p root$ver/etc/e-smith/templates.metadata/etc/opt/rh/rh-mariadb$ver +echo 'TEMPLATE_PATH="/etc/my.cnf"' > root$ver/etc/e-smith/templates.metadata/etc/opt/rh/rh-mariadb$ver/my.cnf + +# rename/move files + +#TODO /etc/e-smith/events +mv root/etc/e-smith/events/smeserver-mariadb$ver-update root$ver/etc/e-smith/events/ +#bootstrap-console-save templates + actions +mkdir -p root$ver/etc/e-smith/events/bootstrap-console-save/templates2expand/etc/e-smith/sql/ +mkdir -p root$ver/etc/e-smith/events/bootstrap-console-save/templates2expand/etc/opt/rh +mv root/etc/e-smith/events/bootstrap-console-save/S40mariadb$ver-load-tables root$ver/etc/e-smith/events/bootstrap-console-save/ +mv root/etc/e-smith/events/bootstrap-console-save/templates2expand/etc/e-smith/sql/init$ver root$ver/etc/e-smith/events/bootstrap-console-save//templates2expand/etc/e-smith/sql/ +mv root/etc/e-smith/events/bootstrap-console-save/templates2expand/etc/opt/rh/rh-mariadb$ver root$ver/etc/e-smith/events/bootstrap-console-save//templates2expand/etc/opt/rh/ +#pre-backup actions +mkdir -p root$ver/etc/e-smith/events/pre-backup +mv root/etc/e-smith/events/pre-backup/S*mariadb$ver-* root$ver/etc/e-smith/events/pre-backup/ +#post-backup actions +mkdir -p root$ver/etc/e-smith/events/post-backup +mv root/etc/e-smith/events/post-backup/S*mariadb$ver-* root$ver/etc/e-smith/events/post-backup/ +#pre-restore actions + service +mkdir -p root$ver/etc/e-smith/events/pre-restore +mv root/etc/e-smith/events/pre-restore/S*mariadb$ver-* root$ver/etc/e-smith/events/pre-restore/ +#timezone-update service + + +#/etc/e-smith/events/actions +#TODO +cp rootscl/etc/e-smith/events/actions/mariadb_VER_-delete-db-files root$ver/etc/e-smith/events/actions/mariadb${ver}-delete-db-files +cp rootscl/etc/e-smith/events/actions/mariadb_VER_-delete-dumped-tables root$ver/etc/e-smith/events/actions/mariadb${ver}-delete-dumped-tables +cp rootscl/etc/e-smith/events/actions/mariadb_VER_-dump-tables root$ver/etc/e-smith/events/actions/mariadb${ver}-dump-tables +cp rootscl/etc/e-smith/events/actions/mariadb_VER_-load-tables root$ver/etc/e-smith/events/actions/mariadb${ver}-load-tables +sed -i root$ver/etc/e-smith/events/actions/mariadb${ver}-delete-db-files \ + -i root$ver/etc/e-smith/events/actions/mariadb${ver}-delete-dumped-tables \ + -i root$ver/etc/e-smith/events/actions/mariadb${ver}-dump-tables \ + -i root$ver/etc/e-smith/events/actions/mariadb${ver}-load-tables \ + -e "s_!!!VER!!!_${ver}_g" \ + -e "s_!!!SOCKET!!!_${socket}_g" + +##metadata +mkdir -p root$ver/etc/e-smith/templates.metadata/etc/e-smith/sql +cp -a root/etc/e-smith/templates.metadata/etc/e-smith/sql/init root$ver/etc/e-smith/templates.metadata/etc/e-smith/sql/init$ver + + +##templates +mkdir -p root$ver/etc/e-smith/templates/etc/e-smith/sql/init$ver +cp root/etc/e-smith/templates/etc/e-smith/sql/init/* root$ver/etc/e-smith/templates/etc/e-smith/sql/init$ver +sed -i root$ver/etc/e-smith/templates/etc/e-smith/sql/init$ver/00_restore_dumped_dbs -i root$ver/etc/e-smith/templates/etc/e-smith/sql/init$ver/10mysql_upgrade \ + -e "s_e-smith/db/mysql_e-smith/db/mariadb${ver}_g" \ + -e "s_/usr/bin/mysql_/opt/rh/rh-mariadb${ver}/root/usr/bin/mysql_g" \ + -e "s_mariadb.service_mariadb$ver-mariadb.service_" \ + -e "s_/var/run/mariadb/mariadb.pid_${pidfile}_g" \ + -e "s_mysqld_mariadb$ver-mariadb_g" \ + -e "s_| mysql |_| /opt/rh/rh-mariadb${ver}/root/usr/bin/mysql --socket=$socket |_g" \ + -e "s_mysql\_upgrade_mysql\_upgrade --socket=$socket _g" +mkdir -p root$ver/etc/e-smith/templates/etc/my.cnf +echo " +[mariadb-$vers]" > root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-05mariadb +echo "basedir=$basedir" > root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-07basedir +echo "datadir=$datadir" > root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-08datadir +#cp -a root/etc/e-smith/templates/etc/my.cnf/009socket root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-09socket +#sed -i root$ver/etc/e-smith/templates/etc/my.cnf/$ver-09socket \ +# -e "s_mariadb_{'mariadb${ver}\-mariadb'}_" \ +# -e "s_^socket.*_socket=${socket}_" +cp rootscl/etc/e-smith/templates/etc/my.conf/_VER_-09socket root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-09socket +sed -i root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-09socket \ + -e "s_!!!VER!!!_${ver}_g" \ + -e "s_!!!PORT!!!_${port}_g" +cp rootscl/etc/e-smith/templates/etc/my.conf/_VER_-10port root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-10port +sed -i root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-10port \ + -e "s_!!!VER!!!_${ver}_g" \ + -e "s_!!!PORT!!!_${port}_g" + +cp -a root/etc/e-smith/templates/etc/my.cnf/014server_system_variables root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-14server_system_variables +sed -i root$ver/etc/e-smith/templates/etc/my.cnf/$ver-14server_system_variables \ + -e "s_mariadb_mariadb${ver}\-mariadb_" +cp -a root/etc/e-smith/templates/etc/my.cnf/015logerror root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-15logerror +sed -i root$ver/etc/e-smith/templates/etc/my.cnf/${ver}-15logerror \ + -e "s_^log\_error.*_log\_error=${logerror}_" + +## /sbin/e-smith +mkdir -p root$ver/sbin/e-smith/systemd +#!!!VER!!! +cp rootscl/sbin/e-smith/systemd/mariadb_VER_-initialize root$ver/sbin/e-smith/systemd/mariadb${ver}-initialize +cp rootscl/sbin/e-smith/systemd/mariadb_VER_-mysql.init root$ver/sbin/e-smith/systemd/mariadb${ver}-mysql.init +cp rootscl/sbin/e-smith/mariadb_VER_-preload root$ver/sbin/e-smith/mariadb${ver}-preload +sed -i root$ver/sbin/e-smith/systemd/mariadb${ver}-initialize -i root$ver/sbin/e-smith/systemd/mariadb${ver}-mysql.init \ + -i root$ver/sbin/e-smith/mariadb${ver}-preload \ + -e "s_!!!VER!!!_${ver}_g" \ + -e "s_!!!SOCKET!!!_${socket}_g" +if [ $ver -ge 104 ] +then + cp rootscl/sbin/e-smith/systemd/mariadb_VER_-post root$ver/sbin/e-smith/systemd/mariadb${ver}-post + sed -i root$ver/sbin/e-smith/systemd/mariadb${ver}-post -e "s_!!!VER!!!_${ver}_g" -e "s_!!!SOCKET!!!_${socket}_g" +fi + + +## logrotate +mkdir -p root$ver/etc/logrotate.d/ +sed rootscl/etc/logrotate.d/mariadb_VER_ -e "s_!!!VER!!!_${ver}_g" \ + -e "s_!!!SOCKET!!!_${socket}_g" > root$ver/etc/logrotate.d/mariadb${ver} + + +#systemd service +mkdir -p root$ver/usr/lib/systemd/system/ +### the upstream service is called rh-mariadb$ver-mariadb.service +# we use our own /usr/lib/systemd/system/mariadb$ver-mariadb +cp rootscl/usr/lib/systemd/system/mariadb_VER_-mariadb.service root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service +cp rootscl/usr/lib/systemd/system/mariadb_VER_-mysql.init.service root$ver/usr/lib/systemd/system/mariadb${ver}-mysql.init.service +sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service -i root$ver/usr/lib/systemd/system/mariadb${ver}-mysql.init.service \ + -e "s_!!!VER!!!_${ver}_g" +if [ $ver -ge 102 ] +then + sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service \ + -e "s/_safe//" \ + -e "s/^ExecStopPost.*//"; +fi +if [ $ver -ge 104 ] +then + sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service \ + -e 's_set.password$_set.password2_' + sed -i root$ver/usr/lib/systemd/system/mariadb${ver}-mariadb.service \ + -e "/^#ExecStartPost=/ i ExecStartPost=\/sbin\/e-smith\/systemd\/mariadb${ver}-post" + +fi + +#### TODO check it is similar to rh one and functional ! + +#/usr/bin to ease user +mkdir root$ver/usr/bin +for i in mysql mysqlshow mysqladmin mysqldump mysqlimport mysqlbinlog +do + echo "/opt/rh/rh-mariadb${ver}/root/usr/bin/$i --socket=/var/lib/mysql/mariadb${ver}.sock \"\$@\"" >root$ver/usr/bin/$i${ver} +done + +#phpMyAdmin template +mkdir -p root$ver/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/ +sed rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql_VER_ \ + -e "s_!!!SOCKET!!!_${socket}_g" \ + -e "s_!!!VER!!!_${ver}_g" > root$ver/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql${ver} + +done + +################################################### +# end of per version generation +################################################## + + +%install +rm -rf $RPM_BUILD_ROOT +(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) +/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ + --file "/sbin/e-smith/systemd/mariadb-initialize" 'attr(0554,root,root)' \ + --file "/sbin/e-smith/systemd/mysql.init" 'attr(0554,root,root)' \ + --dir '/home/e-smith/db/mysql' 'attr(0750,root,root)' \ + --dir "/var/log/mariadb" 'attr(0750,mysql,mysql)' \ + --dir "/var/log/mysql.init" 'attr(0750,root,root)' \ + > %{name}-%{version}-filelist +echo "%doc COPYING" >> %{name}-%{version}-filelist + +for ver in 101 102 103 105 +do +#rm -rf $RPM_BUILD_ROOT +(cd root$ver ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) +/sbin/e-smith/genfilelist root$ver/ \ + --file "/sbin/e-smith/systemd/mariadb$ver-initialize" 'attr(0554,root,root)' \ + --file "/sbin/e-smith/systemd/mariadb$ver-mysql.init" 'attr(0554,root,root)' \ + --file "/sbin/e-smith/systemd/mariadb$ver-post" 'attr(0554,root,root)' \ + --dir "/home/e-smith/db/mariadb$ver" 'attr(0750,root,root)' \ + --dir "/var/log/mariadb$ver" 'attr(0750,mysql,mysql)' \ + --file "/usr/bin/mysql$ver" 'attr(0554,root,root)' \ + --file "/usr/bin/mysqladmin$ver" 'attr(0554,root,root)' \ + --file "/usr/bin/mysqlbinlog$ver" 'attr(0554,root,root)' \ + --file "/usr/bin/mysqldump$ver" 'attr(0554,root,root)' \ + --file "/usr/bin/mysqlimport$ver" 'attr(0554,root,root)' \ + --file "/usr/bin/mysqlshow$ver" 'attr(0554,root,root)' \ +| grep -vE '/home/e-smith/db/mysql$' \ + > %{name}-%{version}-filelist-mariadb$ver +echo "%doc COPYING" >> %{name}-%{version}-filelist-mariadb$ver +done + + +%clean +rm -rf $RPM_BUILD_ROOT + +%pre +if [ $1 -gt 1 ] ; then + if [ -e /var/service/mariadb/run ] ; then + /usr/bin/sv d mariadb + /usr/bin/sv d mariadb/log + fi +fi + +%post + +%postun + +%files -f %{name}-%{version}-filelist +%defattr(-,root,root) + +#---------------------------------------------------- +%package -n smeserver-mariadb101 +Summary: Koozali SME Server mariadb 10.1 +Group: Database +Requires: rh-mariadb101 +Requires: rh-mariadb101-mariadb +Requires: rh-mariadb101-mariadb-server +BuildRequires: e-smith-devtools >= 1.13.1-03 + +%description -n smeserver-mariadb101 +Koozali SME Server configuration package for mariadb101 RH SCLo + +%files -n smeserver-mariadb101 -f %{name}-%{version}-filelist-mariadb101 +%defattr(-,root,root) + +#---------------------------------------------------- +%package -n smeserver-mariadb102 +Summary: Koozali SME Server mariadb 10.2 +Group: Database +Requires: rh-mariadb102 +Requires: rh-mariadb102-mariadb +Requires: rh-mariadb102-mariadb-server +BuildRequires: e-smith-devtools >= 1.13.1-03 + +%description -n smeserver-mariadb102 +Koozali SME Server configuration package for mariadb102 RH SCLo + +%files -n smeserver-mariadb102 -f %{name}-%{version}-filelist-mariadb102 +%defattr(-,root,root) + +#---------------------------------------------------- +%package -n smeserver-mariadb103 +Summary: Koozali SME Server mariadb 10.3 +Group: Database +Requires: rh-mariadb103 +Requires: rh-mariadb103-mariadb +Requires: rh-mariadb103-mariadb-server +Requires: rh-mariadb103-mariadb-server-utils +BuildRequires: e-smith-devtools >= 1.13.1-03 + +%description -n smeserver-mariadb103 +Koozali SME Server configuration package for mariadb103 RH SCLo + +%files -n smeserver-mariadb103 -f %{name}-%{version}-filelist-mariadb103 +%defattr(-,root,root) + +#---------------------------------------------------- +%package -n smeserver-mariadb105 +Summary: Koozali SME Server mariadb 10.5 +Group: Database +Requires: rh-mariadb105 +Requires: rh-mariadb105-mariadb +Requires: rh-mariadb105-mariadb-server +Requires: rh-mariadb105-mariadb-server-utils +BuildRequires: e-smith-devtools >= 1.13.1-03 +Requires: smeserver-mysql >= 2.7.0-5 +%description -n smeserver-mariadb105 +Koozali SME Server configuration package for mariadb105 RH SCLo + +%files -n smeserver-mariadb105 -f %{name}-%{version}-filelist-mariadb105 +%defattr(-,root,root) + + +#---------------------------------------------------- + + +%changelog +* Sat Mar 23 2024 cvs2git.sh aka Brian Read 2.7.0-19.sme +- Roll up patches and move to git repo [SME: 12338] + +* Sat Mar 23 2024 BogusDateBot +- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday, + by assuming the date is correct and changing the weekday. + +* Thu Nov 23 2023 Jean-Philippe Pialasse 2.7.0-18.sme +- fix OpenFilesLimit too low preventing backup [SME: 12417] +- deleting extra folder in /home/e-smith/db/mysql/ for mariadb10* + +* Sun Dec 11 2022 Jean-Philippe Pialasse 2.7.0-17.sme +- fix mariadb overriding skip-networking for other versions [SME: 12262] + +* Mon Jul 11 2022 Jean-Philippe Pialasse 2.7.0-16.sme +- use dedicated log file for *mysql.init [SME: 11953] + +* Tue Jun 07 2022 John Crisp 2.7.0-15.sme +- Fix init for MariaDB 104+ [SME:11991] + +* Sun Apr 10 2022 Jean-Philippe Pialasse 2.7.0-14.sme +- /usr/libexec/mysql-wait-stop not used after mariadb101 [SME: 11936] + +* Sat Apr 09 2022 Jean-Philippe Pialasse 2.7.0-13.sme +- fix few typos [SME: 11936] + +* Sat Apr 02 2022 Jean-Philippe Pialasse 2.7.0-12.sme +- remove SourcePath from mysql-init service file [SME: 11922] + +* Wed Mar 16 2022 Jean-Philippe Pialasse 2.7.0-11.sme +- fix mariadb*-mysql.init path in service file [SME: 11899] + +* Wed Mar 16 2022 Jean-Philipe Pialasse 2.7.0-10.sme +- fix sclo metadata path for sql/init templated scripts [SME: 11899] + +* Wed Mar 16 2022 Jean-Philipe Pialasse 2.7.0-8.sme +- missing sockets for backup of db [SME: 11899] + +* Mon Mar 14 2022 Jean-Philippe Pialasse 2.7.0-7.sme +- adding requirement for mariadb-server-utils (105 and 103) [SME: 11899] + +* Mon Mar 14 2022 Jean-Philippe Pialasse 2.7.0-6.sme +- fix password for mariadb 105 [SME: 11899] + +* Sun Mar 13 2022 Jean-Philippe Pialasse 2.7.0-5.sme +- fix typo in socket, seen with phpmyadmin [SME: 11899] +- fix permissions for mariadb105 [SME: 11899] + create a dedicated set.password for mariadb>103 + +* Sun Mar 13 2022 Jean-Philippe Pialasse 2.7.0-3.sme +- missing phpMyAdmin fragments [SME: 11899] + +* Sun Mar 13 2022 Jean-Philippe Pialasse 2.7.0-2.sme +- fix few sclo issues [SME: 11899] + missing +x for binaries shortcut + mariadb105 passwordless root access + mysqld_safe-scl-helper vs mysqld-scl-helper + +* Fri Mar 11 2022 Jean-Philippe Pialasse 2.7.0-1.sme +- prepare spec for multiple version support [SME: 11899] +- package renamed from e-smith-mysql to smeserver-mysql [SME: 11897] +- remove duplicate logrotate and remove unsused template [SME: 11467] +- move scripts /etc/rc.d/init.d/mysql-init to /sbin/e-smith/systemd [SME: 11898] +- add rh-mariadb101 support [SME: 11901] +- add rh-mariadb102 support [SME: 11902] +- add rh-mariadb103 support [SME: 11903] +- add rh-mariadb105 support [SME: 11904] + +* Tue Aug 17 2021 John Crisp 2.6.0-22.sme +- Remove template and set default max_allowed_packet=16M + +* Thu Mar 18 2021 Jean-Philippe Pialasse 2.6.0-21.sme +- fix wrong path for set password [SME: 11468] + +* Sat Mar 13 2021 Jean-Philipe Pialasse 2.6.0-20.sme +- fix restore of sme9 backup fails to start mysql.init [SME: 11453] + +* Thu Mar 04 2021 Jean-Philipe Pialasse 2.6.0-19.sme +- add property to enable mysqld slow queries log [SME: 455] + simply use SlowQueries as the amount of second and it is enabled + remove property to stop logging +- more mysqld/mariadb parameter available with properties /templates [SME: 4606] +- ease 4 databit characters with innodb [SME: 11404] +- redirect mariadb log from systemd to file [SME: 11425] + +* Wed Jan 27 2021 Jean-Philipe Pialasse 2.6.0-18.sme +- fix backup fails in pre-backup in mysqldump [SME: 7827] + +* Sun Dec 13 2020 Jean-Philipe Pialasse 2.6.0-17.sme +- expand 10mysql_upgrade and restart mysql.init on e-smith-mysql-update [SME: 11120] + this to make sure mariadb upgrade fully and prevent residual 10mysql_upgrade stay in the way + +* Wed Dec 09 2020 Jean-Philipe Pialasse 2.6.0-16.sme +- fix issue with 10mysql_upgrade crashing mariadb [SME: 11120] + also removed noise from spec file + +* Mon Dec 07 2020 Jean-Philipe Pialasse 2.6.0-15.sme +- e-smith-update event [SME: 11145] +- mariadb systemd integration [SME: 11021] + move set.password and template + create /usr/lib/systemd/system/mariadb.service.d/sme.conf + create /sbin/e-smith/systemd/mariadb-initialize + chmod + cleanup and remove old /var/service/mariadb +- mysql.init systemd integration [SME: 11120] + create mysql_init.service + + +* Sun Jul 24 2016 Jean-Philipe Pialasse 2.6.0-13.sme +- systemd skip redirect [SME: 9688] + +* Sat Jul 23 2016 stephane de Labrusse 2.6.0-12.sme +- Corrected a typo in e-smith-mysql-2.6.0.bz9671.RemoveDummyMysqlDatabase.patch +- [SME: 9671] + +* Thu Jul 21 2016 Jean-Philipe Pialasse 2.6.0-11.sme +- fix broken link /etc/init.d/supervise/mariadb [SME: 9686] + +* Mon Jul 18 2016 stephane de Labrusse 2.6.0-10.sme +- Remove Dummy database from backup and restoration [SME: 9671] +- Added e-smith-mysql-2.6.0.bz9671.RemoveDummyMysqlDatabase.patch + +* Mon Jul 18 2016 Jean-Philipe Pialasse 2.6.0-8.sme +- fix forgotten mysqld variables in various scripts [SME: 9438] +- e-smith-mysql-2.6.0-mariadb_forgotten_var.patch + +* Mon Apr 11 2016 Daniel Berteaud 2.6.0-7.sme +- Use default InnoDB settings [SME: 9439] + +* Mon Apr 11 2016 Daniel Berteaud 2.6.0-6.sme +- Rename mysqld to mariadb [SME: 9438] + +* Mon Apr 11 2016 Daniel Berteaud 2.6.0-5.sme +- Remove uneeded scriplets %post and %postun [SME: 9422] + +* Thu Mar 31 2016 Jean-Philipe Pialasse 2.6.0-4.sme +- new path for pid file with mariadb [SME: 9407] +- my.cnf : Innodb needs to be active for mariadb [SME: 9406] + +* Fri Mar 18 2016 Jean-Philipe Pialasse 2.6.0-2.sme +- fix mysql-server not found [SME: 9345] +- now using mariadb-server and mariadb +- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday, + by assuming the date is correct and changing the weekday. + Wed Mar 23 2001 --> Wed Mar 21 2001 or Fri Mar 23 2001 or Wed Mar 28 2001 or .... + +* Fri Feb 05 2016 stephane de Labrusse 2.6.0-1.sme +- Initial release to sme10 + +* Sat Apr 26 2014 Ian Wells 2.4.0-9.sme +- Move mysql logging to multilog [SME: 8358] + +* Mon Apr 14 2014 Ian Wells 2.4.0-8.sme +- Remove the information_schema [SME: 8325] + +* Mon Mar 17 2014 Ian Wells 2.4.0-7.sme +- Use mysql_upgrade in 00_restore_dumped_dbs, by Terje Edseth [SME: 8166] +- Rename 10fix_privilege_tables to 10mysql_upgrade to reduce confusion. + +* Sun Feb 2 2014 Ian Wells 2.4.0-6.sme +- Use mysql_upgrade --force due to upgrade to MySQL 5.1 [SME: 8166] + +* Thu Jun 6 2013 Daniel Berteaud 2.4.0-5.sme +- Ignore mysql.event table [SME: 7603] + +* Wed Mar 20 2013 Ian Wells 2.4.0-4.sme +- Use --single-transaction in mysql-dump-tables [SME: 7497] + +* Sat Mar 16 2013 Ian Wells 2.4.0-3.sme +- Use mysql_upgrade instead of fix_privilege_tables [SME: 7467] + +* Mon Feb 18 2013 Daniel Berteaud 2.4.0-2.sme +- Remove obsolete innodb_log_arch_dir directive [SME: 7363] + +* Wed Feb 13 2013 Shad L. Lords 2.4.0-1.sme +- Roll new stream for sme9 + +* Tue Mar 1 2011 Jonathan Martens 2.2.0-6.sme +- Cater for open_files_limit option my.cnf through database and template [SME: 6438] + +* Thu Oct 28 2010 Shad L. Lords 2.2.0-5.sme +- Fix stripping of starting numbers from script [SME: 6316] + +* Mon Jun 7 2010 Filippo Carletti 2.2.0-4.sme +- Fix %postun typo [SME: 6030] + +* Mon Feb 23 2009 Jonathan Martens 2.2.0-3.sme +- Rework log-error logic [SME: 4807] + +* Tue Dec 2 2008 Jonathan Martens 2.2.0-2.sme +- Fix log-error detection algorithm [SME: 4807] + +* Tue Oct 7 2008 Shad L. Lords 2.2.0-1.sme +- Roll new stream to separate sme7/sme8 trees [SME: 4633] + +* Mon Oct 06 2008 Charlie Brady 1.13.0-2 +- Capture mysql.init error logs to syslog. [SME: 2918] + +* Mon Oct 6 2008 Stephen Noble 1.13.0-1 +- Roll new dev stream [SME: 4627] + +* Wed Jan 09 2008 Stephen Noble 1.12.0-15 +- quote "$1" in post uninstall script [SME: 349] + +* Sun Apr 29 2007 Shad L. Lords +- Clean up spec so package can be built by koji/plague + +* Sat Apr 21 2007 Shad L. Lords 1.12.0-14 +- Force upgrade script to run even with errors. [SME: 2530] + +* Mon Apr 9 2007 Stephen Noble 1.12.0-13 +- Add db settings to max_allowed_packet in my.cnf [SME: 2149] + +* Mon Apr 9 2007 Stephen Noble 1.12.0-12 +- Add to my.cnf [SME: 2149] + +* Thu Jan 11 2007 Shad L. Lords 1.12.0-11 +- Move user to mysql section. [SME: 1474] + +* Wed Dec 27 2006 Shad L. Lords 1.12.0-10 +- Split backups out by database name [SME: 1677] + +* Thu Dec 07 2006 Shad L. Lords +- Update to new release naming. No functional changes. +- Make Packager generic + +* Thu Nov 9 2006 Charlie Brady 1.12.0-08 +- Ensure that failed restore is detected during mysql.init. [SME: 1652] + +* Mon Sep 25 2006 Charlie Brady 1.12.0-07 +- Fix pre-backup failure if mysqld is disabled in config db. [SME: 1937] + +* Tue Jun 27 2006 Filippo Carletti 1.12.0-06 +- Execute mysql_install_db using sh [SME: 1654] + +* Sun Apr 30 2006 Charlie Brady 1.12.0-05 +- Make innodb optional, and configure it as recommended, if enabled. + [SME: 1013] + +* Tue Apr 18 2006 Gordon Rowell 1.12.0-04 +- Add missing semi-colon to FLUSH PRIVILEGES statement [SME: 1229] + +* Mon Apr 10 2006 Gordon Rowell 1.12.0-03 +- Revise last patch - it backed out the db restore [SME: 1229] + +* Mon Apr 10 2006 Gordon Rowell 1.12.0-02 +- Move expansion of user table into set.password so it works + for command line runs as well as db restores [SME: 1229] + +* Thu Mar 16 2006 Gordon Rowell 1.12.0-01 +- Roll stable stream version. [SME: 1016] + +* Mon Feb 13 2006 Charlie Brady 1.11.1-16 +- Update dependencies to include mysql-server RPM. Remove obsolete + dependency on e-smith-packetfilter. [SME: 737] + +* Fri Jan 6 2006 Gordon Rowell 1.11.1-15 +- Remove explicit permission setting for /home/e-smith/db from + genfilelist call [SME: 371] + +* Sun Jan 1 2006 Charlie Brady 1.11.1-14 +- Ensure that mysql is restarted after restore, and avoid race conditions + during mysqld restart during fix_privilege_tables. [SME: 73] +- Remove unnecessary mkdirs in build section - they're done by createlinks + script. + +* Wed Dec 14 2005 Gordon Rowell 1.11.1-13 +- Call fix_privilege_tables much earlier and call mysqladmin shutdown + after doing so - Thanks Paul Floor [SME: 73] + +* Wed Nov 30 2005 Gordon Rowell 1.11.1-12 +- Call mysql fix_privilege_tables in mysql.init [SME: 73] + +* Wed Nov 30 2005 Gordon Rowell 1.11.1-11 +- Bump release number only + +* Tue Nov 15 2005 Gordon Rowell +- [1.11.1-10] +- Reset the format of the MySQL root password for old dumps [SF: 1325378] + +* Wed Aug 31 2005 Charlie Brady +- [1.11.1-09] +- Avoid error from db-delete action if db files are not present + (e.g. because they have already been deleted). [SF: 1273797] + +* Mon Aug 29 2005 Charlie Brady +- [1.11.1-08] +- Fix restore of dumped tables after restore from backup. + Reset root password after restore of dumped dbs. [SF: 1273797] + +* Thu Jun 16 2005 Charlie Brady +- [1.11.1-07] +- Ensure that 'status' property of mysql.init is honoured at + startup. [MN00061795] + +* Tue Jun 14 2005 Charlie Brady +- [1.11.1-06] +- Work around race condition between mysql startup and + mysql.init. [SF: 1217966] + +* Fri Apr 29 2005 Charlie Brady +- [1.11.1-05] +- Use -f flag in mysql-delete-dumped-tables so that backup + doesn't fail if the file is missing. + +* Fri Apr 15 2005 Charlie Brady +- [1.11.1-04] +- Change /root/.my.cnf template to use esmith::util::LdapPassword + rather than read of ldap.pw file, to eliminate ordering + depenendence on ldap.pw template expansion. + +* Fri Apr 15 2005 Charlie Brady +- [1.11.1-03] +- Restore old mysql.init behaviour, to leave any failed scripts + behind for a later attempt, or for admin investigation. [MN00079643] + +* Wed Apr 13 2005 Charlie Brady +- [1.11.1-02] +- Fix up import of tables after a restore. Remove a few bogus + symlinks. + +* Wed Apr 13 2005 Charlie Brady +- [1.11.1-01] +- Roll new development stream - 1.11.1 + +* Mon Apr 11 2005 Charlie Brady +- [1.11.0-16] +- Fix typo and runtime error in run script. Detect table dump + to be restored and set it up for mysql.init to restore it. + +* Sun Apr 10 2005 Charlie Brady +- [1.11.0-15] +- Remove trap stuff in run script (which works around mysqld brokenness) + and add custom control/{t,q,d,i} scripts. + +* Sun Apr 10 2005 Charlie Brady +- [1.11.0-14] +- Remove obsolete e-smith-packetfilter Requires: header. +- Do db initialisation in run script, as required, rather than via + special action script. +- Replace all restart-, start- and reload- actions with calls to + 'adjust-services'. Update e-smith-lib version dependency. [MN00065576] +- Use generic_template_expand action where possible, in place + of specific actions. Update e-smith-lib dependency. [MN00064130] + +* Wed Dec 29 2004 Charlie Brady +- [1.11.0-13] +- Fix permissions on log/run script. Add missing /var/log/mysqld dir. + [charlieb MN00061220] + +* Wed Dec 29 2004 Charlie Brady +- [1.11.0-12] +- Add missing down file in service directory.. Fix permissions + on run script. [charlieb MN00061220] + +* Tue Dec 28 2004 Charlie Brady +- [1.11.0-11] +- Add missing /service/mysqld symlink [charlieb MN00061220] + +* Mon Dec 20 2004 Charlie Brady +- [1.11.0-10] +- Run mysqld under supervise. [charlieb MN00061220] +- Replace deprecated Copyright header with License. [charlieb] + +* Tue Jan 6 2004 Michael Soulier +- [1.11.0-09] +- Added restart to valid arguments to mysql.init. [msoulier 10866] + +* Tue Jan 6 2004 Michael Soulier +- [1.11.0-08] +- Fixed mysql.init leaving behind failed scripts, and the lack of proper + initscript command-line arguments. [msoulier 10866] + +* Wed Dec 24 2003 Tony Clayton +- [1.11.0-07] +- Updating comments in my.cnf [tonyc 10862] +- Don't show redundant log-error option in mysqld_safe [tonyc 10862] + +* Mon Dec 22 2003 Tony Clayton +- [1.11.0-06] +- fixing initscript symlink [tonyc 10862] + +* Mon Dec 22 2003 Tony Clayton +- [1.11.0-05] +- Add /var/run/mysqld dir for mysql.com compatibility [tonyc 10862] +- Fix initscript symlink [tonyc 10862] + +* Mon Dec 22 2003 Tony Clayton +- [1.11.0-04] +- Add initscript symlink for mysql.com compatibility [tonyc 10862] +- Adding /etc/logrotate.d/mysqld templates [tonyc 8662] + +* Thu Dec 18 2003 Tony Clayton +- [1.11.0-03] +- Clean up /etc/my.cnf templates and add comments [tonyc 10862] +- Add a more --user=mysql options to actions for 100% coverage [tonyc 10862] +- Remove redundant basedir/datadir options from actions [tonyc 10862] +- Clean up mysql-preload fork/exec stuff [tonyc 10862] + +* Tue Dec 16 2003 Tony Clayton +- [1.11.0-02] +- Add --user=mysql to mysqld args in conf-mysql-password [tonyc 10853] +- Future-proof /etc/my.cnf for s/safe_mysqld/mysqld_safe/ change [tonyc 8662] + +* Tue Dec 16 2003 Tony Clayton +- [1.11.0-01] +- Changing version to development stream number - 1.11.0 + +* Thu Jun 26 2003 Charlie Brady +- [1.10.0-01] +- Changing version to stable stream number - 1.10.0 + +* Wed Apr 23 2003 Charlie Brady +- [1.9.0-03] +- Remove stray " in mysql-dump-tables. [charlieb 8475] + +* Tue Apr 1 2003 Charlie Brady +- [1.9.0-02] +- Restrict mysql by default to use only unix domain socket. [charlieb 6430] +- Change mysql dump in pre-backup to use quotes, to fix backup/restore problem. + [charlieb 7953] +- Remove conf-mysql-startup - use db initialisation fragments instead + [charlieb 5665] + +* Tue Apr 1 2003 Charlie Brady +- [1.9.0-01] +- Roll development version to 1.9.0 + +* Mon Mar 17 2003 Lijie Deng +- [1.8.0-03] +- Deleted template-begin/end file [lijied 3295] + +* Thu Jan 23 2003 Charlie Brady +- [1.8.0-02] +- Fix typo in mysql-restart action script (mysql => mysqld). [charlieb 4774] + +* Fri Oct 11 2002 Charlie Brady +- [1.8.0-01] +- Rolling stable version number to 1.8.0 + +* Fri Oct 11 2002 Charlie Brady +- [1.8.0-01] +- Rolling stable version number to 1.8.0 + +* Wed Sep 25 2002 Charlie Brady +- [1.7.4-10] +- Reverse the recent logic change in mysql.init, now that action() function + in /etc/rc.d/init.d/functions is repaired. Replace deprecated use + of backticks. [charlieb 4728] + +* Mon Sep 23 2002 Charlie Brady +- [1.7.4-09] +- Actually expand /etc/my.cnf template - that's what it's for! [charlieb 4731] + +* Mon Sep 23 2002 Charlie Brady +- [1.7.4-08] +- Fix logic problem in mysql.init [charlieb 4728] + +* Tue Sep 10 2002 Charlie Brady +- [1.7.4-07] +- Add fragment to my.cnf template to disable (for now) innoDB tables, and + hence prevent log file noise. [charlieb 4731] + +* Mon Sep 9 2002 Charlie Brady +- [1.7.4-06] +- Update mysql-restart action and link into timezone-update event + [charlieb 4774] + +* Mon Sep 9 2002 Charlie Brady +- [1.7.4-05] +- Set $HOME in mysql.init script itself, otherwise it's not set when + run from the rc run script. Fix filenames displayed in progress message. + [charlieb 4782] +- Remove redundant mysql.conf action script [charlieb 4782] + +* Fri Sep 6 2002 Charlie Brady +- [1.7.4-04] +- Create newly required email-update event directory. [charlieb 4782] + +* Fri Sep 6 2002 Charlie Brady +- [1.7.4-03] +- Change mysql-dump-tables and mysql-delete-dumps events to pre-backup and + post-backup events. [charlieb 2745] +- Add mysql-start-if-required action, which checks if mysqld is running, + and start it, then runs mysql.init, if not. Linked into email-update event. + [charlieb 4782] +- Redo conf-mysql-startup using ConfigDB and remove no longer necessary + serviceControl() calls. [charlieb 4782] +- Redo mysql-conf using esmith::templates. [charlieb 4782] +- Change mysql.init script so that it can run programs or just load sql. + [charlieb 4782] + +* Wed Aug 28 2002 Charlie Brady +- [1.7.4-02] +- Create missing /etc/e-smith/sql/init directory [charlieb 4333] + +* Thu Aug 22 2002 Charlie Brady +- [1.7.4-01] +- Remove 45DenyMySQL template fragment - it's no longer needed since we + are using connection tracking. [charlieb 4499] + +* Tue Aug 20 2002 Charlie Brady +- [1.7.3-01] +- Add rc7.d symlinks and don't set obsolete InitscriptsOrder property + of services. [charlieb 4458] + +* Wed Jul 17 2002 Charlie Brady +- [1.7.2-01] +- Change masq script fragment to use iptables. [charlieb 1268] + +* Wed Jun 5 2002 Charlie Brady +- [1.7.1-01] +- Test build to verify CVS conversion + +* Wed Jun 5 2002 Charlie Brady +- [1.7.0-01] +- rollRPM: Rolled version number to 1.7.0-01. Includes patches up to 1.6.0-01. + +* Tue Dec 11 2001 Jason Miller +- [1.6.0-01] +- rollRPM: Rolled version number to 1.6.0-01. Includes patches up to 1.5.0-03. + +* Thu Dec 6 2001 Adrian Chung +- [1.5.0-03] +- Adding more verbose error messages to mysql-dump-tables. +- It should exit 0 if an error occurs, it should exit 1, and complain. + +* Wed Oct 31 2001 Adrian Chung +- [1.5.0-02] +- mysql-restart now restarts mysql if it is running, rather + than only starting it if it is stopped. +- mysql-shutdown has been added +- conf-mysql is now mysql-initialize-db +- new template /etc/my.cnf added +- new action mysql-conf which expands /etc/my.cnf linked to + bootstrap-console-save + +* Mon Oct 29 2001 Adrian Chung +- [1.5.0-01] +- Rolled version number to 1.5.0-01. Includes patches upto 1.4.0-03. +- Removed directive to remove post-restore event. + +* Tue Aug 28 2001 Gordon Rowell +- [1.4.0-03] +- Removed deprecated post-restore event directory + +* Fri Aug 17 2001 gordonr +- [1.4.0-02] +- Autorebuild by rebuildRPM + +* Wed Aug 8 2001 Charlie Brady +- [1.4.0-01] +- Rolled version number to 1.4.0-01. Includes patches upto 1.3.0-18. + +* Wed Aug 08 2001 Tony Clayton +- [1.3.0-18] +- force mysql.init to sort files in init directory + +* Tue Aug 7 2001 Charlie Brady +- [1.3.0-17] +- Fix uninitialised variable problem in masq fragment. + +* Wed Jul 04 2001 Gordon Rowell +- [1.3.0-16] +- Added use esmith::util to mysql-dump-tables + +* Wed Jul 04 2001 Gordon Rowell +- [1.3.0-15] +- Use esmith::util::LdapPassword rather than direct file read + +* Tue May 29 2001 Tony Clayton +- [1.3.0-14] +- fixed actions that had tied %conf when calling serviceControl (2 actions) + +* Sat Apr 07 2001 Gordon Rowell +- [1.3.0-13] +- Forward port patches from 1.2.0-05 to 1.2.0-08 + +* Fri Apr 06 2001 Tony Clayton +- [1.2.0-08] +- fixed mkdir calls in mysql-delete-dumped-tables (arguments in wrong order) + +* Thu Apr 05 2001 Tony Clayton +- [1.3.0-12] +- force mysql.init to print to stderr instead of stout + +* Fri Mar 23 2001 Tony Clayton + Wed Mar 23 2001 --> Wed Mar 21 2001 or Fri Mar 23 2001 or Wed Mar 28 2001 or .... +- [1.3.0-11] +- fixed uninitialized value error in conf-mysql-startup + +* Wed Mar 21 2001 Tony Clayton +- [1.3.0-10] +- fixed error on empty glob in mysql.init + +* Wed Mar 21 2001 Tony Clayton +- [1.3.0-09] +- fixed harmless errors thrown by mysql.init + +* Wed Mar 21 2001 Tony Clayton +- [1.3.0-08] +- fixed tie bug in conf-mysql-startup script which prevented the mysqld service + from being initialized properly. + +* Thu Mar 15 2001 Tony Clayton +- [1.3.0-07] +- created mysql.init initscript +- added serviceControl code for mysql.init in conf-mysql-startup + +* Sat Mar 10 2001 Tony Clayton +- [1.3.0-06] +- fixed mysql call in /sbin/e-smith/mysql-preload + +* Sat Mar 10 2001 Tony Clayton +- [1.3.0-05] +- fixed bugs in /sbin/e-smith/mysql-preload + +* Fri Mar 9 2001 Adrian Chung +- [1.3.0-04] +- added /sbin/e-smith/mysql-preload + +* Sat Mar 3 2001 Charlie Brady +- [1.2.0-07] +- add packetfilter template fragment to deny tcp/3306 + Make packet filter fragment depend on the service db. Only block + TCP SYN packets. +- add Requires for e-smith-packetfilter. +- Add required permissions parameter to mkdir calls. + +* Thu Mar 1 2001 Charlie Brady +- [1.3.0-03] +- Make packet filter fragment depend on the service db. Only block + TCP SYN packets. +- Add required permissions parameter to mkdir calls. + +* Thu Mar 1 2001 Adrian Chung +- [1.3.0-02] +- add packetfilter template fragment to deny tcp/3306 +- add Requires for e-smith-packetfilter. + +* Thu Mar 1 2001 Adrian Chung +- [1.3.0-01] +- Development stream, includes all patches up to and including + 1.2.0-05. +- Ported Charlie's MySQL->mysql requires change to development + stream. Was 1.2.0-06, but not built. + +* Fri Feb 16 2001 Adrian Chung +- [1.2.0-05] +- changed -C option to useradd to a -c for comments. + +* Thu Feb 8 2001 Adrian Chung +- Rolling release number for GPG signing. + +* Thu Jan 25 2001 Adrian Chung +- [1.2.0-03] +- changed conf-mysql-account to 08 instead of 05. + +* Thu Jan 25 2001 Adrian Chung +- [1.2.0-02] +- remove rc0.d/rc6.d symlinks and replace with links to + e-smith-service instead. + +* Thu Jan 25 2001 Peter Samuel +- [1.2.0-01] +- Rolled version number to 1.2.0-01. Includes patches upto 1.1.0-31. + +* Thu Jan 25 2001 Adrian Chung +- [1.1.0-31] +- take expansion of logrotate.d/mysqld template out + of conf-mysqld + +* Wed Jan 24 2001 Adrian Chung +- [1.1.0-30] +- leave logrotate.d/mysqld alone now, back out patch +- expanding /root/.my.cnf with the password alleviates + need to pass -p to mysqladmin + +* Wed Jan 24 2001 Adrian Chung +- [1.1.0-29] +- expand logrotate.d/mysqld template +- add template directory for logrotate.d/mysqld + +* Wed Jan 24 2001 Charlie Brady +- [1.1.0-28] +- Create new mysql-conf-account script - set up mysql account and add it + to the accounts db. Called from post-install and post-upgrade + +* Wed Jan 17 2001 Adrian Chung +- [1.1.0-27] +- default mysql to enabled + +* Wed Jan 17 2001 Peter Samuel +- [1.1.0-26] +- added mysql-delete-dumped-tables action to post-upgrade event + +* Wed Jan 17 2001 Peter Samuel +- [1.1.0-25] +- mysql-dump-tables and mysql-import-tables actions do nothing if mysqld + is not running. +- mysql-dump-tables action does nothing if the dump directory does + not exist. +- mysql-import-tables action does nothing if there is no dump file from + which to import. +- created 2 new events - mysql-delete-dumps and mysql-dump-tables +- removed mysql-import-tables action from post-restore +- added mysql-import-tables action to post-upgrade +- created new action mysql-delete-dumped-tables +- added patch22 to list of patches to be applied - must have been + missed in 1.1.0-24. + +* Sat Jan 13 2001 Adrian Chung +- [1.1.0-24] +- typo $action => restart + +* Sat Jan 13 2001 Adrian Chung +- [1.1.0-23] +- mysql-{import,dump}-tables checks for enabled status of mysqld + before attempting to dump/import + +* Fri Jan 12 2001 Adrian Chung +- [1.1.0-22] +- changed "Couldn't $action mysqld" to "Couldn't restart mysqld". + +* Fri Jan 12 2001 Adrian Chung +- [1.1.0-21] +- $ in front of ENV{'PATH'} + +* Fri Jan 12 2001 Adrian Chung +- [1.1.0-20] +- add PATH setting to conf-mysql + +* Fri Jan 12 2001 Adrian Chung +- [1.1.0-19] +- get rid of --no-defaults + +* Fri Jan 12 2001 Adrian Chung +- [1.1.0-18] +- --force mysql_install_db + +* Fri Jan 12 2001 Tony Clayton +- [1.1.0-17] +- converted to using serviceControl + +* Fri Jan 12 2001 Adrian Chung +- [1.1.0-16] +- conf-mysql needs to run even if the service isn't enabled + so that during runtime, it can be enabled, and just go. + +* Thu Jan 11 2001 Adrian Chung +- [1.1.0-15] +- datadir check should be /var/lib/mysql/mysql. + +* Thu Jan 11 2001 Adrian Chung +- [1.1.0-14] +- conf-mysql-password checks for MySQL datadir first +- mysql-{dump,import}-tables moved to + /etc/e-smith/events/actions +- mysql-import-tables added to post-restore action + +* Thu Jan 11 2001 Adrian Chung +- [1.1.0-13] +- conf-mysql-password resets the root password, and + gets rid of two blank account entries +- /sbin/e-smith/mysql-dump-tables has been added + which dumps mysql.dump to /home/e-smith/db/mysql +- /sbin/e-smith/mysql-import-tables has been added + which imports a mysql.dump text file back into a + running system + +* Thu Jan 11 2001 Adrian Chung +- [1.1.0-12] +- conf-mysql-password now runs in console-save as well. +- if the system is started up without mysqld enabled, + a password won't be set, since there are no mysql tables + initialized yet. + +* Thu Jan 11 2001 Adrian Chung +- [1.1.0-11] +- conf-mysql-password runs without checking whether mysql + is enabled. It does not require mysqld to be started, and + should always at least keep the root password in sync, in + case mysqld is enabled, and started during a running system + session. + +* Thu Jan 11 2001 Adrian Chung +- [1.1.0-10] +- add mysql-conf-startup to post-install/upgrade. + +* Thu Jan 11 2001 Adrian Chung +- [1.1.0-9] +- make conf-mysql-password set the mysql password, instead of + setting up a once-run script. + +* Wed Jan 10 2001 Charlie Brady +- [1.1.0-8] +- Create new mysql-conf-startup script - split from mysql-conf +- Create new bootstrap-console-save event and install mysql-conf into it + +* Mon Dec 18 2000 Adrian Chung +- [1.1.0-7] +- added configuration database to db command.(typo). + +* Mon Dec 18 2000 Adrian Chung +- [1.1.0-6] +- added UnsavedChanges wrapper around script so that it resets + UnsavedChanges flag appropriately. + +* Fri Dec 15 2000 Adrian Chung +- Added chmod 0755 for mysqld-password init script. +- Moved /etc/etc/rc.d to /etc/rc.d + +* Fri Dec 15 2000 Adrian Chung +- Added conf-mysql-password to post-install which sets + up mysqld-password in rc7.d to be run once to set the + password. The mysqld-password script removes it's link + from runlevel 7 and updates the configuration/services + database. + +* Fri Nov 24 2000 Adrian Chung +- Changed mysql to mysqld. + +* Wed Nov 22 2000 Adrian Chung +- Minor modifications to conf-mysql script to make it work + with the RH7.0 version of mysql. + +* Wed Nov 22 2000 Adrian Chung +- Rolled to 1.1.0, for 4.1/7.0 stream. Changed mysql to mysqld. + +* Tue Nov 14 2000 Adrian Chung +- initial release +