diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2008-03-15 00:55:33 +0000 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2008-03-15 00:55:33 +0000 |
commit | 8f7c7af5ec14c4de2e66440c673a1661b2b57802 (patch) | |
tree | d4eb0dfbd8d99f0c6e2e9e597301977263738098 /app-backup | |
parent | Stick credits in ChangeLog. (diff) | |
download | gentoo-2-8f7c7af5ec14c4de2e66440c673a1661b2b57802.tar.gz gentoo-2-8f7c7af5ec14c4de2e66440c673a1661b2b57802.tar.bz2 gentoo-2-8f7c7af5ec14c4de2e66440c673a1661b2b57802.zip |
Backport the pidfile fix from the upcoming 0.7 release.
(Portage version: 2.1.4.4)
Diffstat (limited to 'app-backup')
-rw-r--r-- | app-backup/mylvmbackup/ChangeLog | 11 | ||||
-rw-r--r-- | app-backup/mylvmbackup/files/mylvmbackup-0.6-pidfile-fix.patch | 182 | ||||
-rw-r--r-- | app-backup/mylvmbackup/mylvmbackup-0.4_pre1.ebuild | 10 | ||||
-rw-r--r-- | app-backup/mylvmbackup/mylvmbackup-0.6-r1.ebuild | 34 | ||||
-rw-r--r-- | app-backup/mylvmbackup/mylvmbackup-0.6.ebuild | 6 |
5 files changed, 233 insertions, 10 deletions
diff --git a/app-backup/mylvmbackup/ChangeLog b/app-backup/mylvmbackup/ChangeLog index 01bee6ff1402..25ea08f3effa 100644 --- a/app-backup/mylvmbackup/ChangeLog +++ b/app-backup/mylvmbackup/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for app-backup/mylvmbackup -# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-backup/mylvmbackup/ChangeLog,v 1.4 2007/12/04 18:29:00 robbat2 Exp $ +# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-backup/mylvmbackup/ChangeLog,v 1.5 2008/03/15 00:55:32 robbat2 Exp $ + +*mylvmbackup-0.6-r1 (15 Mar 2008) + + 15 Mar 2008; Robin H. Johnson <robbat2@gentoo.org> + +files/mylvmbackup-0.6-pidfile-fix.patch, mylvmbackup-0.4_pre1.ebuild, + mylvmbackup-0.6.ebuild, +mylvmbackup-0.6-r1.ebuild: + Backport the pidfile fix from the upcoming 0.7 release. *mylvmbackup-0.6 (04 Dec 2007) diff --git a/app-backup/mylvmbackup/files/mylvmbackup-0.6-pidfile-fix.patch b/app-backup/mylvmbackup/files/mylvmbackup-0.6-pidfile-fix.patch new file mode 100644 index 000000000000..1959b1db7d10 --- /dev/null +++ b/app-backup/mylvmbackup/files/mylvmbackup-0.6-pidfile-fix.patch @@ -0,0 +1,182 @@ +diff -Nuar --exclude .svn tags/mylvmbackup-0.6/ChangeLog trunk/ChangeLog +--- tags/mylvmbackup-0.6/ChangeLog 2008-03-14 17:28:39.000000000 -0700 ++++ trunk/ChangeLog 2008-03-14 17:28:37.000000000 -0700 +@@ -1,3 +1,16 @@ ++2008-03-03 Lenz Grimmer <lenz@grimmer.com> ++ ++ - Bug fix: use the correct mysqld parameter to provide an alternative PID ++ file (--pid-file instead of --pidfile) - thanks to Guillaume Boddaert for ++ reporting this! ++ - Added option "--skip_mycnf" to skip including a copy of the MySQL ++ configuration file in the backup, added a safety check that the file ++ actually exists prior to backing it up. ++ ++2007-10-27 Lenz Grimmer <lenz@grimmer.com> ++ ++ - Bumped up version number to 0.7 ++ + 2007-10-27 Lenz Grimmer <lenz@grimmer.com> + + - Use mktemp/mkdtemp to generate the random temporary file/directory names +diff -Nuar --exclude .svn tags/mylvmbackup-0.6/man/mylvmbackup.1.txt trunk/man/mylvmbackup.1.txt +--- tags/mylvmbackup-0.6/man/mylvmbackup.1.txt 2008-03-14 17:28:39.000000000 -0700 ++++ trunk/man/mylvmbackup.1.txt 2008-03-14 17:28:37.000000000 -0700 +@@ -137,9 +137,13 @@ + Only used to perform InnoDB recovery. + + --mycnf=string:: +- Specifies the pathname for the MySQL config file to include in the backup. ++ Specifies the name of the MySQL config file to include in the backup. + The default is '/etc/my.cnf'. + ++--skip_mycnf:: ++ Skip backing up the MySQL configuration file. ++ The default is to include a copy of the configuration file in the backup. ++ + --vgname=string:: + Specifies the volume group of the logical volume where the MySQL + data directory is located. +diff -Nuar --exclude .svn tags/mylvmbackup-0.6/mylvmbackup.conf trunk/mylvmbackup.conf +--- tags/mylvmbackup-0.6/mylvmbackup.conf 2008-03-14 17:28:39.000000000 -0700 ++++ trunk/mylvmbackup.conf 2008-03-14 17:28:37.000000000 -0700 +@@ -59,6 +59,7 @@ + pidfile=/var/tmp/mylvmbackup_recoverserver.pid + skip_flush_tables=0 + extra_flush_tables=0 ++skip_mycnf=0 + + # + # Logging options. The Sys::Syslog module is required for syslog option +diff -Nuar --exclude .svn tags/mylvmbackup-0.6/mylvmbackup.pl.in trunk/mylvmbackup.pl.in +--- tags/mylvmbackup-0.6/mylvmbackup.pl.in 2008-03-14 17:28:39.000000000 -0700 ++++ trunk/mylvmbackup.pl.in 2008-03-14 17:28:37.000000000 -0700 +@@ -42,6 +42,7 @@ + my $host; + my $innodb_recover; + my $skip_flush_tables; ++my $skip_mycnf; + my $extra_flush_tables; + my $lvcreate; + my $lvname; +@@ -223,8 +224,11 @@ + log_msg ("Recovering innodb...", LOG_INFO); + do_innodb_recover(); + } +- log_msg ("Copying $mycnf_basename...", LOG_INFO); +- create_mycnf_file(); ++ if (-f $mycnf && $skip_mycnf == 0) ++ { ++ log_msg ("Copying $mycnf_basename...", LOG_INFO); ++ create_mycnf_file(); ++ } + + log_msg ("Taking actual backup...", LOG_INFO); + do_backup_tar() if ($backuptype eq 'tar'); +@@ -263,6 +267,7 @@ + $pidfile=$cfg->val ('misc', 'pidfile', $pidfile); + $skip_flush_tables=$cfg->val ('misc', 'skip_flush_tables', $skip_flush_tables); + $extra_flush_tables=$cfg->val ('misc', 'extra_flush_tables', $extra_flush_tables); ++ $skip_mycnf=$cfg->val ('misc', 'skip_mycnf', $skip_mycnf); + $rsyncarg=$cfg->val ('misc', 'rsyncarg', $rsyncarg); + $tararg=$cfg->val ('misc', 'tararg', $tararg); + $tarsuffixarg=$cfg->val ('misc', 'tarsuffixarg', $tarsuffixarg); +@@ -318,6 +323,7 @@ + "pidfile=s" => \$pidfile, + "skip_flush_tables" => \&skip_flush_tables, + "extra_flush_tables" => \&extra_flush_tables, ++ "skip_mycnf" => \&skip_mycnf, + "tararg=s" => \$tararg, + "tarsuffixarg=s" => \$tarsuffixarg, + "tarfilesuffix=s" => \$tarfilesuffix, +@@ -372,6 +378,7 @@ + $pidfile = '/var/tmp/mylvmbackup_recoverserver.pid'; + $skip_flush_tables=0; + $extra_flush_tables=0; ++ $skip_mycnf=0; + $tararg='cvzf'; + $tarsuffixarg=''; + $tarfilesuffix='.tar.gz'; +@@ -403,7 +410,7 @@ + { + my $dbh = shift; + my $pos_file; +- open $pos_file, ">$pos_filename" or log_msg ("Cannot open $pos_filename for write", LOG_ERR) && die ("Cannot open $pos_filename for write"); ++ open $pos_file, ">$pos_filename" or log_msg ("Cannot open $pos_filename for writing: $!", LOG_ERR) && die ("Cannot open $pos_filename for writing: $!"); + &_create_pos_file_single($dbh,'SHOW MASTER STATUS',$pos_file,'Master'); + &_create_pos_file_single($dbh,'SHOW SLAVE STATUS',$pos_file,'Slave'); + close $pos_file; +@@ -412,7 +419,7 @@ + sub create_mycnf_file + { + use File::Copy; +- copy($mycnf, $mycnf_filename); ++ copy($mycnf, $mycnf_filename) or log_msg ("Could not copy $mycnf to $mycnf_filename: $!") && die ("Could not copy $mycnf to $mycnf_filename: $!\n"); + } + + sub _create_pos_file_single +@@ -494,7 +501,7 @@ + + sub do_innodb_recover + { +- if ( system("echo 'select 1;' | $mysqld_safe --pidfile=$pidfile --datadir=$mountdir --skip-networking --skip-grant --bootstrap --skip-ndbcluster --skip-slave-start") != 0 ) ++ if ( system("echo 'select 1;' | $mysqld_safe --pid-file=$pidfile --datadir=$mountdir --skip-networking --skip-grant --bootstrap --skip-ndbcluster --skip-slave-start") != 0 ) + { + log_msg ("Failed to perform InnoDB recovery on the snapshot!", LOG_ERR); + } +@@ -590,10 +597,15 @@ + sub skip_flush_tables { + $skip_flush_tables = 1; + } ++ + sub extra_flush_tables { + $extra_flush_tables = 1; + } + ++sub skip_mycnf { ++ $skip_mycnf = 1; ++} ++ + sub need_xfsworkaround { + $need_xfsworkaround = 1; + } +diff -Nuar --exclude .svn tags/mylvmbackup-0.6/TODO trunk/TODO +--- tags/mylvmbackup-0.6/TODO 2008-03-14 17:28:39.000000000 -0700 ++++ trunk/TODO 2008-03-14 17:28:37.000000000 -0700 +@@ -1,16 +1,32 @@ + mylvmbackup TODO list: + +- - Document the new logging options in the man page and help output +- - Make backing up of my.cnf optional, verify that the file actually exists +- before copying it ++ - Improve the InnoDB recovery function: create a separate my.cnf for the ++ server instance that performs the recovery on the snapshot, including the ++ InnoDB-related parameters from the main my.cnf file (particularly table spaces, ++ log files) as well as other options (e.g. sane buffer sizes) ++ - Investigate further about the need of calling xfs_freeze prior to taking ++ the snapshot when using XFS file systems. According to the docs, this is ++ not needed when using LVM2 (and may even lead to deadlocks), but may be ++ needed for LVM1 (without the VFS-lock patch). How could this be detected ++ automatically? How to snapshot file systems that support storing log files ++ on separate block devices? + - Modularize the backup portion + - Support other backup methods than tar after modularizing +- * rsync - http://rsync.samba.org/ (already available as a hack, add +- support for remote backups) ++ * rsync - http://rsync.samba.org/ (already available as a hack, needs ++ some cleanups/improvements) + * rsnapshot - http://www.rsnapshot.org/ + * duplicity - http://duplicity.nongnu.org/ + * unison - http://www.cis.upenn.edu/~bcpierce/unison/ + * zip - http://www.info-zip.org/Zip.html ++ - rsync backup: add support for remote backups ++ - rsync backup: allow backing up into the same directory (no time stamps), ++ to increase backup speed (using the differential capabilities of rsync) ++ - rsync backup: support the --link-dest option, to preserve disk space on ++ the backup drive ++ - tar backup: check if the "z" option is used for tar, change the archive ++ name suffix accordingly (.tar.gz vs. .tar) ++ - Support other snapshot options in addition to LVM snapshots (e.g. Sun's ZFS ++ snapshots/clones) + - Allow splitting of archives. Could this be done by being able to modularize + the backup part and allowing multiple plugins in a pipe? E.g. a generic + splitting plugin that can split any archives. diff --git a/app-backup/mylvmbackup/mylvmbackup-0.4_pre1.ebuild b/app-backup/mylvmbackup/mylvmbackup-0.4_pre1.ebuild index 338ca9e9cc65..9461ff423866 100644 --- a/app-backup/mylvmbackup/mylvmbackup-0.4_pre1.ebuild +++ b/app-backup/mylvmbackup/mylvmbackup-0.4_pre1.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2007 Gentoo Foundation +# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-backup/mylvmbackup/mylvmbackup-0.4_pre1.ebuild,v 1.3 2007/01/15 18:59:45 robbat2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-backup/mylvmbackup/mylvmbackup-0.4_pre1.ebuild,v 1.4 2008/03/15 00:55:32 robbat2 Exp $ inherit eutils @@ -23,15 +23,15 @@ S="${WORKDIR}/${PN}-${MY_PV}" src_unpack() { unpack ${PN}-${MY_PV}.tar.gz - epatch ${DISTDIR}/${PN}-0.3-to-0.4-changes.patch.gz + epatch "${DISTDIR}"/${PN}-0.3-to-0.4-changes.patch.gz sed -i \ -e '/^VERSION/s,0.4,0.4_pre1,' \ -e '/^prefix/s,/usr/local,/usr,' \ - ${S}/Makefile + "${S}"/Makefile # Clean up one thinko sed -i \ -e '/^my$/d' \ - ${S}/mylvmbackup.pl.in + "${S}"/mylvmbackup.pl.in } src_install() { diff --git a/app-backup/mylvmbackup/mylvmbackup-0.6-r1.ebuild b/app-backup/mylvmbackup/mylvmbackup-0.6-r1.ebuild new file mode 100644 index 000000000000..e15fee82315b --- /dev/null +++ b/app-backup/mylvmbackup/mylvmbackup-0.6-r1.ebuild @@ -0,0 +1,34 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-backup/mylvmbackup/mylvmbackup-0.6-r1.ebuild,v 1.1 2008/03/15 00:55:32 robbat2 Exp $ + +inherit eutils + +DESCRIPTION="mylvmbackup is a Perl script for quickly creating backups of MySQL server's data files utilizing LVM snapshots." +HOMEPAGE="http://lenz.homelinux.org/mylvmbackup/" +SRC_URI="http://lenz.homelinux.org/${PN}/${P}.tar.gz" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86 ~ppc ~amd64" +IUSE="" +DEPEND=">=app-text/asciidoc-8.1.0" +RDEPEND="dev-perl/Config-IniFiles + >=sys-fs/lvm2-2.02.06 + dev-perl/DBD-mysql + virtual/mysql" + +src_unpack() { + unpack ${A} + sed -i \ + -e '/^prefix/s,/usr/local,/usr,' \ + "${S}"/Makefile + + cd "${S}" + epatch "${FILESDIR}"/mylvmbackup-0.6-pidfile-fix.patch +} + +src_install() { + emake -j1 install DESTDIR="${D}" + dodoc ChangeLog README TODO + keepdir /var/tmp/${PN}/{backup,mnt} +} diff --git a/app-backup/mylvmbackup/mylvmbackup-0.6.ebuild b/app-backup/mylvmbackup/mylvmbackup-0.6.ebuild index 6bfbea9286b9..a0e457f66c8e 100644 --- a/app-backup/mylvmbackup/mylvmbackup-0.6.ebuild +++ b/app-backup/mylvmbackup/mylvmbackup-0.6.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2007 Gentoo Foundation +# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-backup/mylvmbackup/mylvmbackup-0.6.ebuild,v 1.1 2007/12/04 18:29:00 robbat2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-backup/mylvmbackup/mylvmbackup-0.6.ebuild,v 1.2 2008/03/15 00:55:32 robbat2 Exp $ inherit eutils @@ -21,7 +21,7 @@ src_unpack() { unpack ${A} sed -i \ -e '/^prefix/s,/usr/local,/usr,' \ - ${S}/Makefile + "${S}"/Makefile } src_install() { |