PaiPix feedback on /etc/init.d/mysql /etc/init.d/postgresql (tikiwiki and pmb)

Antonio Amorim <[email protected]> Tue, 25 Jan 2005 00:39:05 +0000
Newsgroups gmane.comp.cms.tiki.devel,gmane.linux.debian.knoppix
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------000300000506060907050503
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Dear colleagues,
     (This message is also relevant for the tikiwiki and pmb live 
installation)
     The database sever mysql (and also postgresql in the case of 
PaiPix) have to start with the database files in /var/lib/mysql (...). 
Most of the files in /var/lib are set as links in the knoppix boot 
process. This is reasonable since it reduces the ramdisk consumption. 
However the database servers do not work properly this way.
      To make the databases read/write without waisting memory when the 
servers are not running, I have modified the init scripts such that, 
when they start, if they find links instead of files, they actually 
rsync the full databases.
      When we perform the disk installation the script still works 
normally since it finds the proper databases in /var/lib/mysql and not 
links. Any update of this for disk installations is also ok since these 
features are no longer required. In the case of PaiPix this action is 
also included for the installed packages tikiwiki 
(http://www.tikiwiki.org) and the library catalog software pmb 
(http://www.pizz.net/) that need some read/write files in /var/lib.

This patches are in attachment. Please consider that, in the mysql case, 
the patch applies to the mysql version 4.1 server.
The Debian packages for tikiwiki and pmb are included in PaiPix and 
available from our site:
http://aamorimsrv.fis.fc.ul.pt/mirrors/paipix/PAIPIX/i386/tikiwiki_1.9-4_all.deb
http://aamorimsrv.fis.fc.ul.pt/mirrors/paipix/PAIPIX/i386/phpmybibli_2.0-1_all.deb
(I will discuss these packages in another email).

   All patches are available from one single Debian package:
http://aamorimsrv.fis.fc.ul.pt/mirrors/paipix/PAIPIX/i386/paipix-patches_3.7-7_all.deb
See also http://aamorimsrv.fis.fc.ul.pt/

All the best,
Antonio Amorim


--------------000300000506060907050503
Content-Type: text/plain;
 name="mysql.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="mysql.patch"

--- mysql	2005-01-14 22:53:25.000000000 +0000
+++ mysql.new	2005-01-14 22:57:10.000000000 +0000
@@ -54,6 +54,19 @@
 
 case "${1:-''}" in
   'start')
+        #making soma data read-write to allow working on live cd
+        if [ -L /var/lib/mysql/mysql/db.frm ]; then
+            rsync -a --delete /KNOPPIX/var/lib/mysql/* /var/lib/mysql
+            echo "Making the MySQL Databases ReadWrite"
+        fi
+        if [ -L /var/lib/tikiwiki/tiki-install.php ]; then
+            rsync -a --delete /KNOPPIX/var/lib/tikiwiki/* /var/lib/tikiwiki
+            echo "Making the necessary tikiwiki pages ReadWrite"
+        fi
+        if [ -L /var/lib/phpmybibli/db_param.inc.php ]; then
+            rsync -a --delete /KNOPPIX/var/lib/phpmybibli/* /var/lib/phpmybibli
+            echo "Making the necessary phpMyBibli pages ReadWrite"
+        fi
 	# check for config file
 	if [ ! -r /etc/mysql/my.cnf ]; then
 	  /bin/echo -e "\nWARNING: /etc/mysql/my.cnf cannot be read. See README.Debian."

--------------000300000506060907050503
Content-Type: text/plain;
 name="postgresql.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="postgresql.patch"

--- ../../paipix-original/postgresql	2004-12-27 16:59:21.000000000 +0000
+++ postgresql	2004-12-27 17:21:01.000000000 +0000
@@ -28,6 +28,20 @@
 }
 
 startup () {
+        # PAIPIX
+        if [ -L /var/lib/postgres/data/base/1/PG_VERSION ]; then
+           rsync -a --delete /KNOPPIX/var/lib/postgres/* /var/lib/postgres
+           echo "Making the Postgresql Databases ReadWrite"
+        fi
+        if [ -L /var/lib/tikiwiki/tiki-install.php ]; then
+           rsync -a --delete /KNOPPIX/var/lib/tikiwiki/* /var/lib/tikiwiki
+           echo "Making the necessary tikiwiki Databases ReadWrite"
+        fi
+        if [ -L /var/lib/phpmybibli/db_param.inc.php ]; then
+           rsync -a --delete /KNOPPIX/var/lib/phpmybibli/* /var/lib/phpmybibli
+           echo "Making the necessary phpMyBibli pages ReadWrite"
+        fi
+
 	echo -n " postmaster"
         assert_logfile
 

--------------000300000506060907050503--


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl