public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
* [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 98f3d9b58113a48163bda0b03044a4a49935d8d0
@ 2014-01-26 18:35 git
  0 siblings, 0 replies; only message in thread
From: git @ 2014-01-26 18:35 UTC (permalink / raw)
  To: ipfire-scm

[-- Attachment #1: Type: text/plain, Size: 4767 bytes --]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".

The branch, next has been updated
       via  98f3d9b58113a48163bda0b03044a4a49935d8d0 (commit)
      from  fa37e705d96ae4b09e357dd869c5911b66b7b4d7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 98f3d9b58113a48163bda0b03044a4a49935d8d0
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date:   Sun Jan 26 16:55:33 2014 +0100

    mysql: Fix updating the package.
    
    The mysql server daemon will now be stopped before the update
    is executed and all configuration and data files will be
    backed up.

-----------------------------------------------------------------------

Summary of changes:
 config/backup/includes/mysql    |  2 ++
 config/rootfiles/packages/mysql |  1 +
 lfs/mysql                       |  2 ++
 src/paks/mysql/install.sh       | 10 +++++++++-
 src/paks/mysql/uninstall.sh     |  9 +++++++++
 src/paks/mysql/update.sh        | 28 ++++++++++++++++++++++++++--
 6 files changed, 49 insertions(+), 3 deletions(-)
 create mode 100644 config/backup/includes/mysql

Difference in files:
diff --git a/config/backup/includes/mysql b/config/backup/includes/mysql
new file mode 100644
index 0000000..bcb837c
--- /dev/null
+++ b/config/backup/includes/mysql
@@ -0,0 +1,2 @@
+/etc/my.cnf
+/srv/mysql
diff --git a/config/rootfiles/packages/mysql b/config/rootfiles/packages/mysql
index b03ee11..0beaca8 100644
--- a/config/rootfiles/packages/mysql
+++ b/config/rootfiles/packages/mysql
@@ -299,4 +299,5 @@ usr/share/mysql
 #usr/share/mysql/swedish/errmsg.sys
 #usr/share/mysql/ukrainian
 #usr/share/mysql/ukrainian/errmsg.sys
+var/ipfire/backup/addons/includes/mysql
 var/run/mysql
diff --git a/lfs/mysql b/lfs/mysql
index aa5c357..edcd651 100644
--- a/lfs/mysql
+++ b/lfs/mysql
@@ -100,5 +100,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 	chgrp -v mysql /srv/mysql{,/test,/mysql}
 	chown mysql.mysql /srv/mysql/
 	install -v -m755 -o mysql -g mysql -d /var/run/mysql
+	install -v -m 644 $(DIR_SRC)/config/backup/includes/mysql \
+		/var/ipfire/backup/addons/includes/mysql
 	@rm -rf $(DIR_APP)
 	@$(POSTBUILD)
diff --git a/src/paks/mysql/install.sh b/src/paks/mysql/install.sh
index 20a9924..a27d09e 100644
--- a/src/paks/mysql/install.sh
+++ b/src/paks/mysql/install.sh
@@ -22,11 +22,17 @@
 ############################################################################
 #
 . /opt/pakfire/lib/functions.sh
+
 extract_files
+
 ln -svf  ../init.d/mysql /etc/rc.d/rc0.d/K26mysql
 ln -svf  ../init.d/mysql /etc/rc.d/rc3.d/S34mysql
 ln -svf  ../init.d/mysql /etc/rc.d/rc6.d/K26mysql
-/etc/init.d/mysql start
+
+restore_backup "${NAME}"
+
+start_service "${NAME}"
+
 COUNTER=0
 while [ "$COUNTER" -lt "10" ]; do
 	[ -e "/var/run/mysql/mysql.sock" ] && break
@@ -34,6 +40,8 @@ while [ "$COUNTER" -lt "10" ]; do
 	sleep 5
 	COUNTER=$(($COUNTER + 1))
 done 
+
 [ -e "/var/run/mysql/mysql.sock" ] || (echo "MySQL still noch running... Exiting."; \
 	exit 1)
+
 mysqladmin -u root --password='' password 'mysqlfire'
diff --git a/src/paks/mysql/uninstall.sh b/src/paks/mysql/uninstall.sh
index ed4ff02..a312b2e 100644
--- a/src/paks/mysql/uninstall.sh
+++ b/src/paks/mysql/uninstall.sh
@@ -22,5 +22,14 @@
 ############################################################################
 #
 . /opt/pakfire/lib/functions.sh
+
+# Stop the mysql service
+stop_service "${NAME}"
+
+# Make backup
+make_backup "${NAME}"
+
 remove_files
+
+# Remove start links.
 rm -rvf /etc/rc.d/rc*.d/*mysql
diff --git a/src/paks/mysql/update.sh b/src/paks/mysql/update.sh
index 89c40d0..548b9db 100644
--- a/src/paks/mysql/update.sh
+++ b/src/paks/mysql/update.sh
@@ -22,5 +22,29 @@
 ############################################################################
 #
 . /opt/pakfire/lib/functions.sh
-./uninstall.sh
-./install.sh
+
+# Create backup include file if it is missing.
+if [ ! -e "/var/ipfire/backup/addons/includes/mysql" ]; then
+	cat <<EOF > /var/ipfire/backup/addons/includes/mysql
+/etc/my.cnf
+/srv/mysql
+EOF
+fi
+
+# Stop the mysql service
+stop_service "${NAME}"
+
+# Make backup
+make_backup "${NAME}"
+
+# Update files
+remove_files
+extract_files
+
+# Restore backup
+restore_backup "${NAME}"
+
+# Restart the service
+start_service "${NAME}"
+
+exit 0


hooks/post-receive
--
IPFire 2.x development tree

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-01-26 18:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-26 18:35 [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 98f3d9b58113a48163bda0b03044a4a49935d8d0 git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox