wok rev 1152

mysql,postgresql: backup volatile files
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Jul 26 17:57:04 2008 +0000 (2008-07-26)
parents 1f6a0ebbf926
children 0e74237199bc
files mysql/receipt phpmyadmin/receipt phppgadmin/receipt postgresql/receipt
line diff
     1.1 --- a/mysql/receipt	Sat Jul 26 18:58:09 2008 +0200
     1.2 +++ b/mysql/receipt	Sat Jul 26 17:57:04 2008 +0000
     1.3 @@ -49,6 +49,10 @@
     1.4  # Pre and post install commands for Tazpkg.
     1.5  post_install()
     1.6  {
     1.7 +	( cd $1/ ; cpio -o -H newc | gzip -9 ) > \
     1.8 +		$1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT
     1.9 +etc/my.cnf
    1.10 +EOT
    1.11  	# adduser mysql if needed
    1.12  	if ! grep -q mysql $1/etc/passwd; then
    1.13  		echo -n "Adding user mysql..."
    1.14 @@ -78,3 +82,8 @@
    1.15  	deluser mysql
    1.16  	delgroup mysql
    1.17  }
    1.18 +
    1.19 +repack_cleanup()
    1.20 +{
    1.21 +        zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id )
    1.22 +}
     2.1 --- a/phpmyadmin/receipt	Sat Jul 26 18:58:09 2008 +0200
     2.2 +++ b/phpmyadmin/receipt	Sat Jul 26 17:57:04 2008 +0000
     2.3 @@ -31,6 +31,10 @@
     2.4  
     2.5  post_install()
     2.6  {
     2.7 +	( cd $1/ ; cpio -o -H newc | gzip -9 ) > \
     2.8 +		$1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT
     2.9 +etc/phpmyadmin/config.inc.php
    2.10 +EOT
    2.11  	if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
    2.12  		if ! grep -q /usr/share/phpmyadmin/ $1/etc/lighttpd/lighttpd.conf; then
    2.13  	    		sed -e 's|.*"/examples/" => "/usr/share/examples/",|    "/examples/" => "/usr/share/examples/",\n    "/phpmyadmin/" => "/usr/share/phpmyadmin/",|g' -i $1/etc/lighttpd/lighttpd.conf
    2.14 @@ -43,3 +47,7 @@
    2.15  	fi
    2.16  }
    2.17  
    2.18 +repack_cleanup()
    2.19 +{
    2.20 +        zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id )
    2.21 +}
     3.1 --- a/phppgadmin/receipt	Sat Jul 26 18:58:09 2008 +0200
     3.2 +++ b/phppgadmin/receipt	Sat Jul 26 17:57:04 2008 +0000
     3.3 @@ -24,6 +24,7 @@
     3.4  	cp -a $src/. $fs/usr/share/phppgadmin
     3.5  	mv $fs/usr/share/phppgadmin/conf $fs/etc/phppgadmin
     3.6  	ln -s /etc/phppgadmin $fs/usr/share/phppgadmin/conf
     3.7 +	sed -i -e "s/conf\['extra_login_security'\] = true/conf['extra_login_security'] = false/" $fs/etc/phppgadmin/config.inc.php
     3.8  	chown -R www.www $fs/usr/share/phppgadmin $fs/etc/phppgadmin
     3.9  	chmod 700 $fs/etc/phppgadmin
    3.10  	chmod 600 $fs/etc/phppgadmin/*
    3.11 @@ -31,6 +32,10 @@
    3.12  
    3.13  post_install()
    3.14  {
    3.15 +	( cd $1/ ; cpio -o -H newc | gzip -9 ) > \
    3.16 +		$1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT
    3.17 +etc/phppgadmin/config.inc.php
    3.18 +EOT
    3.19  	if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
    3.20  		if ! grep -q /usr/share/phppgadmin/ $1/etc/lighttpd/lighttpd.conf; then
    3.21  	    		sed -e 's|.*"/examples/" => "/usr/share/examples/",|    "/examples/" => "/usr/share/examples/",\n    "/phppgadmin/" => "/usr/share/phppgadmin/",|g' -i $1/etc/lighttpd/lighttpd.conf
    3.22 @@ -43,3 +48,7 @@
    3.23  	fi
    3.24  }
    3.25  
    3.26 +repack_cleanup()
    3.27 +{
    3.28 +        zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id )
    3.29 +}
     4.1 --- a/postgresql/receipt	Sat Jul 26 18:58:09 2008 +0200
     4.2 +++ b/postgresql/receipt	Sat Jul 26 17:57:04 2008 +0000
     4.3 @@ -66,6 +66,8 @@
     4.4  	chroot $1/ chown -R postgres.postgres /var/lib/pgsql /var/log/postgresql
     4.5  	cat <<EOF
     4.6  ----
     4.7 +postgres has superuser access.
     4.8 +Configure /var/lib/pgsql/*.conf files.
     4.9  To start $PACKAGE server you can run :
    4.10  
    4.11      /etc/init.d/$PACKAGE start