From: git@ipfire.org
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 98f3d9b58113a48163bda0b03044a4a49935d8d0
Date: Sun, 26 Jan 2014 19:35:41 +0100 [thread overview]
Message-ID: <20140126183549.9BDDA208F1@argus.ipfire.org> (raw)
[-- 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
reply other threads:[~2014-01-26 18:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140126183549.9BDDA208F1@argus.ipfire.org \
--to=git@ipfire.org \
--cc=ipfire-scm@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox