--- mylvmbackup-0.13.orig/debian/dirs +++ mylvmbackup-0.13/debian/dirs @@ -0,0 +1,3 @@ +usr/bin +var/cache/mylvmbackup/backup/ +var/cache/mylvmbackup/mnt/ --- mylvmbackup-0.13.orig/debian/bzr-builder.manifest +++ mylvmbackup-0.13/debian/bzr-builder.manifest @@ -0,0 +1,2 @@ +# bzr-builder format 0.3 deb-version {debupstream}-2ubuntu1~8 +lp:~brightbox/ubuntu/precise/mylvmbackup/fix-for-1086313 revid:neil@aldur.co.uk-20121204104613-ob92r3fb3lg5v3kh --- mylvmbackup-0.13.orig/debian/changelog +++ mylvmbackup-0.13/debian/changelog @@ -0,0 +1,106 @@ +mylvmbackup (0.13-2ubuntu1~8~precise1) precise; urgency=low + + * Auto build. + + -- Neil Wilson Tue, 04 Dec 2012 17:44:10 +0000 + +mylvmbackup (0.13-2ubuntu1) UNRELEASED; urgency=low + + * debian/patches/1086313-add-thin-support.dpatch: + add support for thin snapshots (LP: #1086313) + + -- Neil Wilson Tue, 04 Dec 2012 10:45:41 +0000 + +mylvmbackup (0.13-2) unstable; urgency=medium + + * Set umask before creating the backup. (closes: #518471) + * Update upstream homepage. (closes: #608058) + + -- Norbert Tretkowski Mon, 14 Feb 2011 13:34:43 +0100 + +mylvmbackup (0.13-1) unstable; urgency=low + + * New upstream release. + * Fix some lintian warnings: + + copyright-refers-to-versionless-license-file + + debhelper-but-no-misc-depends + + -- Norbert Tretkowski Thu, 14 Jan 2010 21:15:20 +0100 + +mylvmbackup (0.12-1) unstable; urgency=low + + * New upstream release. + * Now maintained by Debian MySQL Maintainers. + + -- Norbert Tretkowski Fri, 03 Jul 2009 09:21:01 +0200 + +mylvmbackup (0.11-1) unstable; urgency=low + + * New upstream release. + + -- Norbert Tretkowski Wed, 21 Jan 2009 12:29:48 +0100 + +mylvmbackup (0.10-1) unstable; urgency=low + + * New upstream release. + + Add missing entry for "lvs" to mylvmbackup.conf. (closes: #494105) + + -- Norbert Tretkowski Sun, 14 Sep 2008 11:39:26 +0200 + +mylvmbackup (0.9-1) unstable; urgency=low + + * New upstream release. + * Add version to asciidoc build-dependency. (closes: #489566) + + -- Norbert Tretkowski Fri, 11 Jul 2008 11:35:58 +0200 + +mylvmbackup (0.8-1) unstable; urgency=low + + * New upstream release. + + -- Norbert Tretkowski Tue, 15 Apr 2008 22:08:03 +0200 + +mylvmbackup (0.7-1) unstable; urgency=low + + * New upstream release. + + -- Norbert Tretkowski Tue, 08 Apr 2008 14:09:42 +0200 + +mylvmbackup (0.6-5) unstable; urgency=low + + * Move upstream website in control file to source stanza. + + -- Norbert Tretkowski Wed, 26 Mar 2008 22:09:07 +0100 + +mylvmbackup (0.6-4) unstable; urgency=low + + * Add upstream website to long description. + * Use /var/run/mysqld/ instead /var/tmp/ for PID file of InnoDB recovery. + + -- Norbert Tretkowski Sat, 03 Nov 2007 11:15:25 +0100 + +mylvmbackup (0.6-3) unstable; urgency=low + + * Change mode of /etc/mylvmbackup.conf to 600 in postinst. + + -- Norbert Tretkowski Mon, 29 Oct 2007 19:45:24 +0100 + +mylvmbackup (0.6-2) unstable; urgency=low + + * Use dpatch for patch management. + * Include /etc/mysql/my.cnf instead /etc/my.cnf in the backup. + + -- Norbert Tretkowski Sun, 28 Oct 2007 19:06:55 +0100 + +mylvmbackup (0.6-1) unstable; urgency=low + + * New upstream release. + * Add libtimedate-perl dependency. + + -- Norbert Tretkowski Sun, 28 Oct 2007 17:57:53 +0100 + +mylvmbackup (0.5-1) unstable; urgency=low + + * Initial release. (closes: #448228) + + -- Norbert Tretkowski Sat, 27 Oct 2007 12:22:15 +0200 --- mylvmbackup-0.13.orig/debian/docs +++ mylvmbackup-0.13/debian/docs @@ -0,0 +1,2 @@ +README +TODO --- mylvmbackup-0.13.orig/debian/rules +++ mylvmbackup-0.13/debian/rules @@ -0,0 +1,85 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +include /usr/share/dpatch/dpatch.make + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp patch + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #docbook-to-man debian/mylvmbackup.sgml > mylvmbackup.1 + + touch $@ + +clean: unpatch + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + $(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/mylvmbackup. + $(MAKE) prefix=/usr DESTDIR=$(CURDIR)/debian/mylvmbackup install + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installexamples +# dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure unpatch --- mylvmbackup-0.13.orig/debian/postinst +++ mylvmbackup-0.13/debian/postinst @@ -0,0 +1,44 @@ +#!/bin/sh +# postinst script for mylvmbackup +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + if [ -f /etc/mylvmbackup.conf ] ; then + chmod 600 /etc/mylvmbackup.conf + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- mylvmbackup-0.13.orig/debian/control +++ mylvmbackup-0.13/debian/control @@ -0,0 +1,22 @@ +Source: mylvmbackup +Section: misc +Priority: extra +Maintainer: Debian MySQL Maintainers +Uploaders: Norbert Tretkowski +Build-Depends: debhelper (>= 5), dpatch, asciidoc (>= 8.2.0), xsltproc, docbook-xsl +Standards-Version: 3.9.1 +Homepage: http://lenzg.net/mylvmbackup/ +Vcs-Browser: http://svn.debian.org/wsvn/pkg-mysql/mylvmbackup/ +Vcs-Svn: svn://svn.debian.org/svn/pkg-mysql/mylvmbackup/ + +Package: mylvmbackup +Architecture: all +Depends: ${perl:Depends}, ${misc:Depends}, libdbd-mysql-perl, libtimedate-perl, libconfig-inifiles-perl, lvm2 +Suggests: mysql-server +Description: quickly creating backups of MySQL server's data files + To perform a backup, mylvmbackup obtains a read lock on all tables and + flushes all server caches to disk, makes an LVM snapshot of the volume + containing the MySQL data directory, and unlocks the tables again. The + snapshot process takes only a small amount of time. When it is done, the + server can continue normal operations, while the actual file backup + proceeds. --- mylvmbackup-0.13.orig/debian/compat +++ mylvmbackup-0.13/debian/compat @@ -0,0 +1 @@ +5 --- mylvmbackup-0.13.orig/debian/copyright +++ mylvmbackup-0.13/debian/copyright @@ -0,0 +1,31 @@ +This package was debianized by Norbert Tretkowski on +Sat, 27 Oct 2007 12:22:15 +0200. + +It was downloaded from http://www.lenzg.org/mylvmbackup/ + +Upstream Author: + + Lenz Grimmer + +Copyright: + + (C) 2006, 2007 Lenz Grimmer + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 dated June, 1991. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + + +The Debian packaging is (C) 2007, Norbert Tretkowski and +is licensed under the GPL, see `/usr/share/common-licenses/GPL-2'. --- mylvmbackup-0.13.orig/debian/patches/01_fix-makefile-path.diff +++ mylvmbackup-0.13/debian/patches/01_fix-makefile-path.diff @@ -0,0 +1,28 @@ +#! /bin/sh -e +## DP: 01_fix-makefile-path.diff +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +--- mylvmbackup-0.6.orig/Makefile 2007-05-31 11:31:29.000000000 +0200 ++++ mylvmbackup-0.6/Makefile 2007-10-28 19:16:08.000000000 +0100 +@@ -45,7 +45,7 @@ + sysconfdir = /etc + bindir = $(prefix)/bin + distdir = $(NAME)-$(VERSION) +-mandir = $(prefix)/man ++mandir = $(prefix)/share/man + man1dir = $(mandir)/man1 + + all: $(DISTFILES) $(MAN1) --- mylvmbackup-0.13.orig/debian/patches/02_fix-config-paths.diff +++ mylvmbackup-0.13/debian/patches/02_fix-config-paths.diff @@ -0,0 +1,111 @@ +#! /bin/sh -e +## DP: 02_fix-config-paths.diff +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -Nur mylvmbackup-0.13.orig/man/mylvmbackup.pod mylvmbackup-0.13/man/mylvmbackup.pod +--- mylvmbackup-0.13.orig/man/mylvmbackup.pod 2009-06-26 17:49:08.000000000 +0200 ++++ mylvmbackup-0.13/man/mylvmbackup.pod 2010-01-13 12:50:38.000000000 +0100 +@@ -230,7 +230,7 @@ + that is spawned to perform the InnoDB recovery (see option + I<--innodb_recover>). Must be different from the PID file that the actual + running server uses. +-The default is I ++The default is I + + =item B<--lvcreate=string> + +@@ -344,7 +344,7 @@ + =item B<--mountdir=string> + + Path for mounting the snapshot volume to. +-The default value is I. ++The default value is I. + If the directory does not exist, it will be created. + + It is possible to use selected I formatting sequences to create +@@ -382,7 +382,7 @@ + This requires a properly configured remote rsync setup (e.g. pre-setup SSH keys + or a working rsyncd configuration). + +-The default is I ++The default is I + + =item B<--mount=string> + +diff -Nur mylvmbackup-0.13.orig/mylvmbackup.conf mylvmbackup-0.13/mylvmbackup.conf +--- mylvmbackup-0.13.orig/mylvmbackup.conf 2009-09-05 15:44:09.000000000 +0200 ++++ mylvmbackup-0.13/mylvmbackup.conf 2010-01-13 12:51:16.000000000 +0100 +@@ -18,7 +18,7 @@ + host= + port= + socket= +-mycnf=/etc/my.cnf ++mycnf=/etc/mysql/my.cnf + + # + # LVM-specific options +@@ -34,8 +34,8 @@ + # + [fs] + xfs=0 +-mountdir=/var/tmp/mylvmbackup/mnt/ +-backupdir=/var/tmp/mylvmbackup/backup/ ++mountdir=/var/cache/mylvmbackup/mnt/ ++backupdir=/var/cache/mylvmbackup/backup/ + relpath= + + # +@@ -80,7 +80,7 @@ + rsnaparg=7 + datefmt=%Y%m%d_%H%M%S + innodb_recover=0 +-pidfile=/var/tmp/mylvmbackup_recoverserver.pid ++pidfile=/var/run/mylvmbackup_recoverserver.pid + skip_flush_tables=0 + extra_flush_tables=0 + skip_mycnf=0 +diff -Nur mylvmbackup-0.13.orig/mylvmbackup.pl.in mylvmbackup-0.13/mylvmbackup.pl.in +--- mylvmbackup-0.13.orig/mylvmbackup.pl.in 2009-09-05 15:44:09.000000000 +0200 ++++ mylvmbackup-0.13/mylvmbackup.pl.in 2010-01-13 12:57:46.000000000 +0100 +@@ -406,7 +406,7 @@ + $port = ''; + $socket = ''; + $mysqld_safe='mysqld_safe'; +- $mycnf = '/etc/my.cnf'; ++ $mycnf = '/etc/mysql/my.cnf'; + + # lvm + $vgname='mysql'; +@@ -420,7 +420,7 @@ + $suffix='_mysql'; + $datefmt='%Y%m%d_%H%M%S'; + $innodb_recover=0; +- $pidfile = '$TMP/mylvmbackup_recoverserver.pid'; ++ $pidfile = '/var/run/mylvmbackup_recoverserver.pid'; + $skip_flush_tables=0; + $extra_flush_tables=0; + $skip_mycnf=0; +@@ -437,8 +437,8 @@ + $quiet=0; + + # fs +- $mountdir='/var/tmp/mylvmbackup/mnt/'; +- $backupdir='/var/tmp/mylvmbackup/backup/'; ++ $mountdir='/var/cache/mylvmbackup/mnt/'; ++ $backupdir='/var/cache/mylvmbackup/backup/'; + $relpath=''; + $need_xfsworkaround=0; + --- mylvmbackup-0.13.orig/debian/patches/03_set-umask.diff +++ mylvmbackup-0.13/debian/patches/03_set-umask.diff @@ -0,0 +1,27 @@ +#! /bin/sh -e +## DP: 03_set-umask.diff +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +--- mylvmbackup-0.13.orig/mylvmbackup.pl.in 2011-02-14 14:04:25.000000000 +0100 ++++ mylvmbackup-0.13/mylvmbackup.pl.in 2011-02-14 14:04:31.000000000 +0100 +@@ -510,6 +510,7 @@ + { + my $tarball = $archivename.$tarfilesuffix; + my $tarballtmp = mktemp("$tarball.INCOMPLETE-XXXXXXX"); ++ umask 077; + + log_msg ("Taking actual backup...", LOG_INFO); + log_msg ("Creating tar archive $tarball", LOG_INFO); --- mylvmbackup-0.13.orig/debian/patches/00list +++ mylvmbackup-0.13/debian/patches/00list @@ -0,0 +1,4 @@ +01_fix-makefile-path.diff +02_fix-config-paths.diff +03_set-umask.diff +1086313-add-thin-support.dpatch --- mylvmbackup-0.13.orig/debian/patches/1086313-add-thin-support.dpatch +++ mylvmbackup-0.13/debian/patches/1086313-add-thin-support.dpatch @@ -0,0 +1,83 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## Description: add some description +## Origin/Author: add some origin or author +## Bug: bug URL +## 1086313-add-thin-support.dpatch by Neil Wilson +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mylvmbackup~/man/mylvmbackup.pod mylvmbackup/man/mylvmbackup.pod +--- mylvmbackup~/man/mylvmbackup.pod 2012-12-04 10:44:05.000000000 +0000 ++++ mylvmbackup/man/mylvmbackup.pod 2012-12-04 10:44:57.762590948 +0000 +@@ -305,6 +305,12 @@ + not be useful if the snapshot is removed. You need to manually unmount this + directory before invoking mylvmbackup again. + ++=item B<--thin> ++ ++If this option is given, mylvmbackup will expect that the LVM volume is ++using thin provisioning and that the snapshot will use physical space ++from the existing thin pool. Any size specified with I is ignored. ++ + =item B<--relpath=string> + + Relative path on the logical volume to the MySQL data directory (no leading or +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' mylvmbackup~/mylvmbackup.pl.in mylvmbackup/mylvmbackup.pl.in +--- mylvmbackup~/mylvmbackup.pl.in 2012-12-04 10:44:05.000000000 +0000 ++++ mylvmbackup/mylvmbackup.pl.in 2012-12-04 10:44:57.762590948 +0000 +@@ -87,6 +87,7 @@ + my $syslog_socktype; + my $syslog_facility; + my $syslog_remotehost; ++my $use_thin_snapshots; + + # Load defaults into variables + load_defaults(); +@@ -301,6 +302,7 @@ + $keep_snapshot=$cfg->val ('misc', 'keep_snapshot', $keep_snapshot); + $keep_mount=$cfg->val ('misc', 'keep_mount', $keep_mount); + $quiet=$cfg->val ('misc', 'quiet', $quiet); ++ $use_thin_snapshots=$cfg->val ('misc', 'thin', $use_thin_snapshots); + + $mountdir=$cfg->val ('fs', 'mountdir', $mountdir); + $backupdir=$cfg->val ('fs', 'backupdir', $backupdir); +@@ -366,6 +368,7 @@ + "skip_hooks" => \&skip_hooks, + "keep_snapshot" => \&keep_snapshot, + "keep_mount" => \&keep_mount, ++ "thin" => \&use_thin_snapshots, + "quiet" => \&quiet, + + # fs +@@ -435,6 +438,7 @@ + $keep_snapshot=0; + $keep_mount=0; + $quiet=0; ++ $use_thin_snapshots=0; + + # fs + $mountdir='/var/tmp/mylvmbackup/mnt/'; +@@ -628,7 +632,9 @@ + + sub create_lvm_snapshot + { +- my $command= "$lvcreate -s --size=$lvsize --name=$backuplv /dev/$vgname/$lvname"; ++ my $params = ''; ++ $params = "--size=$lvsize" unless $use_thin_snapshots; ++ my $command= "$lvcreate -s $params --name=$backuplv /dev/$vgname/$lvname"; + return run_command("taking LVM snapshot", $command); + } + +@@ -749,6 +755,10 @@ + $keep_mount = 1; + } + ++sub use_thin_snapshots { ++ $use_thin_snapshots = 1; ++} ++ + sub quiet { + $quiet = 1; + }