Merge lp:~percona-dev/percona-xtrabackup/safe-slave-backup into lp:percona-xtrabackup/2.0
- safe-slave-backup
- Merge into 2.0
Proposed by
Aleksandr Kuzminsky
Status: | Merged |
---|---|
Approved by: | Vadim Tkachenko |
Approved revision: | no longer in the source branch. |
Merged at revision: | 211 |
Proposed branch: | lp:~percona-dev/percona-xtrabackup/safe-slave-backup |
Merge into: | lp:percona-xtrabackup/2.0 |
Diff against target: |
1812 lines (+1583/-2) (has conflicts) 28 files modified
innobackupex-1.5.1 (+101/-2) utils/debian/README.Debian (+6/-0) utils/debian/changelog (+16/-0) utils/debian/compat (+1/-0) utils/debian/control (+15/-0) utils/debian/copyright (+24/-0) utils/debian/cron.d.ex (+4/-0) utils/debian/dirs (+2/-0) utils/debian/docs (+2/-0) utils/debian/emacsen-install.ex (+45/-0) utils/debian/emacsen-remove.ex (+15/-0) utils/debian/emacsen-startup.ex (+25/-0) utils/debian/info (+1/-0) utils/debian/init.d.ex (+157/-0) utils/debian/init.d.lsb.ex (+296/-0) utils/debian/manpage.1.ex (+59/-0) utils/debian/manpage.sgml.ex (+156/-0) utils/debian/manpage.xml.ex (+291/-0) utils/debian/menu.ex (+2/-0) utils/debian/postinst.ex (+41/-0) utils/debian/postrm.ex (+39/-0) utils/debian/preinst.ex (+37/-0) utils/debian/prerm.ex (+40/-0) utils/debian/rules (+109/-0) utils/debian/watch.ex (+23/-0) utils/debian/xtrabackup.default.ex (+10/-0) utils/debian/xtrabackup.doc-base.EX (+22/-0) utils/xtrabackup.spec (+44/-0) Text conflict in innobackupex-1.5.1 Conflict adding file utils/debian. Moved existing file to utils/debian.moved. Text conflict in utils/xtrabackup.spec |
To merge this branch: | bzr merge lp:~percona-dev/percona-xtrabackup/safe-slave-backup |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Percona developers | Pending | ||
Review via email: mp+32227@code.launchpad.net |
Commit message
Description of the change
The branch with feature:
This branch adds two new options: --safe-slave-backup and --safe-
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'innobackupex-1.5.1' |
2 | --- innobackupex-1.5.1 2010-08-10 12:28:48 +0000 |
3 | +++ innobackupex-1.5.1 2010-08-10 17:17:44 +0000 |
4 | @@ -94,6 +94,9 @@ |
5 | my $option_force_tar = ''; |
6 | my $option_scp_opt = '-Cp -c arcfour'; |
7 | |
8 | +my $option_safe_slave_backup = ''; |
9 | +my $option_safe_slave_backup_timeout = 300; |
10 | + |
11 | # name of the my.cnf configuration file |
12 | #my $config_file = ''; |
13 | |
14 | @@ -447,6 +450,20 @@ |
15 | server with TCP/IP. |
16 | Try 'mysql --help' for more details on this option. |
17 | |
18 | + --safe-slave-backup |
19 | + Stop slave SQL thread and wait to start backup until |
20 | + Slave_open_temp_tables in SHOW STATUS is zero. If |
21 | + there are no open temp tables, the backup will take place, |
22 | + else the SQL thread will be started and stopped until there |
23 | + are no open temp tables. The backup will fail if |
24 | + Slave_open_temp_tables does not become zero after |
25 | + --safe-slave-backup-timeout seconds. The slave SQL thread |
26 | + will be restarted when the backup finishes. |
27 | + |
28 | + --safe-slave-backup-timeout |
29 | + How many seconds --safe-slave-backup should wait for |
30 | + Slave_open_temp_tables to become zero. (default 300) |
31 | + |
32 | --slave-info |
33 | This option is useful when backing up a replication |
34 | slave server. It prints the binary log position and |
35 | @@ -547,12 +564,16 @@ |
36 | # connect to database |
37 | mysql_open(); |
38 | |
39 | + if ( $option_safe_slave_backup ) { |
40 | + wait_for_safe_slave(); |
41 | + } |
42 | + |
43 | # flush tables with read lock |
44 | mysql_check(); |
45 | mysql_lockall() if !$option_no_lock; |
46 | |
47 | } |
48 | - |
49 | + |
50 | # backup .frm, .MRG, .MYD, .MYI, .TRG, .TRN, .ARM, .ARZ and .opt files |
51 | backup_files(); |
52 | |
53 | @@ -563,6 +584,11 @@ |
54 | # release read locks on all tables |
55 | mysql_unlockall() if !$option_no_lock; |
56 | |
57 | + if ( $option_safe_slave_backup ) { |
58 | + print STDERR "$prefix: Starting slave SQL thread\n"; |
59 | + mysql_send('START SLAVE SQL_THREAD;'); |
60 | + } |
61 | + |
62 | # disconnect from database |
63 | mysql_close(); |
64 | } |
65 | @@ -1719,7 +1745,11 @@ |
66 | 'no-lock' => \$option_no_lock, |
67 | 'ibbackup=s' => \$option_ibbackup_binary, |
68 | 'scpopt=s' => \$option_scp_opt, |
69 | - 'force-tar', => \$option_force_tar); |
70 | + 'force-tar', => \$option_force_tar, |
71 | + 'safe-slave-backup' => \$option_safe_slave_backup, |
72 | + 'safe-slave-backup-timeout' => $option_safe_slave_backup_timeout, |
73 | + ); |
74 | + |
75 | if (!$rcode) { |
76 | # failed to read options |
77 | print STDERR "$prefix Bad command line arguments\n"; |
78 | @@ -2301,6 +2331,7 @@ |
79 | return $str; |
80 | |
81 | } |
82 | +<<<<<<< TREE |
83 | |
84 | sub set_xtrabackup_version { |
85 | # Based on MySQL version choose correct binary |
86 | @@ -2340,3 +2371,71 @@ |
87 | return $ibbackup_binary; |
88 | } |
89 | |
90 | +======= |
91 | + |
92 | +# Wait until it's safe to backup a slave. Returns immediately if |
93 | +# the host isn't a slave. Currently there's only one check: |
94 | +# Slave_open_temp_tables has to be zero. Dies on timeout. |
95 | +sub wait_for_safe_slave { |
96 | + my @lines; |
97 | + |
98 | + my $host_is_slave = 0; |
99 | + mysql_send 'SHOW SLAVE STATUS\G;'; |
100 | + file_to_array($mysql_stdout, \@lines); |
101 | + foreach my $line ( @lines ) { |
102 | + if ( $line =~ m/Read_Master_Log_Pos/ ) { |
103 | + $host_is_slave = 1; |
104 | + last; |
105 | + } |
106 | + } |
107 | + if ( !$host_is_slave ) { |
108 | + print STDERR "$prefix: Not checking slave open temp tables for --safe-slave-backup because host is not a slave\n"; |
109 | + return; |
110 | + } |
111 | + |
112 | + mysql_send 'STOP SLAVE SQL_THREAD;'; |
113 | + |
114 | + my $open_temp_tables = get_slave_open_temp_tables(); |
115 | + print STDERR "$prefix: Slave open temp tables: $open_temp_tables\n"; |
116 | + |
117 | + return if $open_temp_tables == 0; |
118 | + |
119 | + my $sleep_time = 3; |
120 | + my $n_attempts = int($option_safe_slave_backup_timeout / $sleep_time) || 1; |
121 | + while ( $n_attempts-- ) { |
122 | + print STDERR "$prefix: Starting slave SQL thread, waiting $sleep_time seconds, then checking Slave_open_temp_tables again ($n_attempts attempts remaining)...\n"; |
123 | + |
124 | + mysql_send 'START SLAVE SQL_THREAD;'; |
125 | + sleep $sleep_time; |
126 | + mysql_send 'STOP SLAVE SQL_THREAD;'; |
127 | + |
128 | + $open_temp_tables = get_slave_open_temp_tables(); |
129 | + print STDERR "$prefix: Slave open temp tables: $open_temp_tables\n"; |
130 | + if ( !$open_temp_tables ) { |
131 | + print STDERR "$prefix: Slave is safe to backup\n"; |
132 | + return; |
133 | + } |
134 | + } |
135 | + |
136 | + Die "Slave_open_temp_tables did not become zero after waiting $option_safe_slave_backup_timeout seconds"; |
137 | +} |
138 | + |
139 | +sub get_slave_open_temp_tables { |
140 | + my @lines; |
141 | + mysql_send 'SHOW STATUS LIKE "slave_open_temp_tables"\G;'; |
142 | + file_to_array($mysql_stdout, \@lines); |
143 | + my $last_value; |
144 | + for my $i ( 0..$#lines ) { |
145 | + $last_value = $i + 1 |
146 | + if $lines[$i] =~ m/Variable_name: Slave_open_temp_tables/i; |
147 | + } |
148 | + Die "SHOW STATUS LIKE 'slave_open_temp_tables' did not return anything" |
149 | + unless $last_value; |
150 | + |
151 | + Die "Failed to get Slave_open_temp_tables from SHOW STATUS" |
152 | + unless defined $lines[$last_value]; |
153 | + |
154 | + my ($n) = $lines[$last_value] =~ m/(\d+)/; |
155 | + return $n; |
156 | +} |
157 | +>>>>>>> MERGE-SOURCE |
158 | |
159 | === added directory 'utils/debian' |
160 | === renamed directory 'utils/debian' => 'utils/debian.moved' |
161 | === added file 'utils/debian/README.Debian' |
162 | --- utils/debian/README.Debian 1970-01-01 00:00:00 +0000 |
163 | +++ utils/debian/README.Debian 2010-08-10 17:17:44 +0000 |
164 | @@ -0,0 +1,6 @@ |
165 | +xtrabackup for Debian |
166 | +--------------------- |
167 | + |
168 | +<possible notes regarding this package - if none, delete this file> |
169 | + |
170 | + -- Alex <aleksandr.kuzminsky@percona.com> Sun, 28 Jun 2009 14:20:17 -0700 |
171 | |
172 | === added file 'utils/debian/changelog' |
173 | --- utils/debian/changelog 1970-01-01 00:00:00 +0000 |
174 | +++ utils/debian/changelog 2010-08-10 17:17:44 +0000 |
175 | @@ -0,0 +1,16 @@ |
176 | +xtrabackup (1.2) unstable; urgency=low |
177 | + |
178 | + * XtraBackup is based on XtraDB 10 |
179 | + |
180 | + -- Aleksandr Kuzminsky <aleksandr.kuzminsky@percona.com> Wed, 07 Mar 2010 23:45:00 +0200 |
181 | +xtrabackup (1.1) unstable; urgency=low |
182 | + |
183 | + * XtraBackup is ported to InnoDB plugin |
184 | + |
185 | + -- Aleksandr Kuzminsky <aleksandr.kuzminsky@percona.com> Mon, 15 Mar 2010 07:00:00 +0200 |
186 | +xtrabackup (1.0) unstable; urgency=low |
187 | + |
188 | + * Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP> |
189 | + |
190 | + -- Alex <aleksandr.kuzminsky@percona.com> Sun, 28 Jun 2009 14:20:17 -0700 |
191 | + |
192 | |
193 | === added file 'utils/debian/compat' |
194 | --- utils/debian/compat 1970-01-01 00:00:00 +0000 |
195 | +++ utils/debian/compat 2010-08-10 17:17:44 +0000 |
196 | @@ -0,0 +1,1 @@ |
197 | +7 |
198 | |
199 | === added file 'utils/debian/control' |
200 | --- utils/debian/control 1970-01-01 00:00:00 +0000 |
201 | +++ utils/debian/control 2010-08-10 17:17:44 +0000 |
202 | @@ -0,0 +1,15 @@ |
203 | +Source: xtrabackup |
204 | +Section: misc |
205 | +Priority: extra |
206 | +Maintainer: Aleksandr Kuzminsky <aleksandr.kuzminsky@percona.com> |
207 | +Build-Depends: debhelper, autotools-dev |
208 | +Standards-Version: 3.7.3 |
209 | +Homepage: https://launchpad.net/percona-xtrabackup |
210 | +Vcs-Browser: http://bazaar.launchpad.net/~percona-dev/percona-xtrabackup/release-1.2/files |
211 | +Vcs-Bzr: bzr+ssh://bazaar.launchpad.net/~percona-dev/percona-xtrabackup/release-1.2/ |
212 | + |
213 | +Package: xtrabackup |
214 | +Architecture: any |
215 | +Depends: ${shlibs:Depends}, ${misc:Depends}, mysql-client |
216 | +Description: Open source backup tool for InnoDB and XtraDB |
217 | + Open source backup tool for InnoDB and XtraDB |
218 | |
219 | === added file 'utils/debian/copyright' |
220 | --- utils/debian/copyright 1970-01-01 00:00:00 +0000 |
221 | +++ utils/debian/copyright 2010-08-10 17:17:44 +0000 |
222 | @@ -0,0 +1,24 @@ |
223 | +This package was debianized by Alex <aleksandr.kuzminsky@percona.com> on |
224 | +Sun, 28 Jun 2009 14:20:17 -0700. |
225 | + |
226 | +It was downloaded from <url://example.com> |
227 | + |
228 | +Upstream Author(s): |
229 | + |
230 | + <put author's name and email here> |
231 | + <likewise for another author> |
232 | + |
233 | +Copyright: |
234 | + |
235 | + <Copyright (C) YYYY Name OfAuthor> |
236 | + <likewise for another author> |
237 | + |
238 | +License: |
239 | + |
240 | + <Put the license of the package here indented by 4 spaces> |
241 | + |
242 | +The Debian packaging is (C) 2009, Alex <aleksandr.kuzminsky@percona.com> and |
243 | +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. |
244 | + |
245 | +# Please also look if there are files or directories which have a |
246 | +# different copyright/license attached and list them here. |
247 | |
248 | === added file 'utils/debian/cron.d.ex' |
249 | --- utils/debian/cron.d.ex 1970-01-01 00:00:00 +0000 |
250 | +++ utils/debian/cron.d.ex 2010-08-10 17:17:44 +0000 |
251 | @@ -0,0 +1,4 @@ |
252 | +# |
253 | +# Regular cron jobs for the xtrabackup package |
254 | +# |
255 | +0 4 * * * root [ -x /usr/bin/xtrabackup_maintenance ] && /usr/bin/xtrabackup_maintenance |
256 | |
257 | === added file 'utils/debian/dirs' |
258 | --- utils/debian/dirs 1970-01-01 00:00:00 +0000 |
259 | +++ utils/debian/dirs 2010-08-10 17:17:44 +0000 |
260 | @@ -0,0 +1,2 @@ |
261 | +usr/bin |
262 | +usr/sbin |
263 | |
264 | === added file 'utils/debian/docs' |
265 | --- utils/debian/docs 1970-01-01 00:00:00 +0000 |
266 | +++ utils/debian/docs 2010-08-10 17:17:44 +0000 |
267 | @@ -0,0 +1,2 @@ |
268 | +CMakeLists.txt |
269 | +README |
270 | |
271 | === added file 'utils/debian/emacsen-install.ex' |
272 | --- utils/debian/emacsen-install.ex 1970-01-01 00:00:00 +0000 |
273 | +++ utils/debian/emacsen-install.ex 2010-08-10 17:17:44 +0000 |
274 | @@ -0,0 +1,45 @@ |
275 | +#! /bin/sh -e |
276 | +# /usr/lib/emacsen-common/packages/install/xtrabackup |
277 | + |
278 | +# Written by Jim Van Zandt <jrv@debian.org>, borrowing heavily |
279 | +# from the install scripts for gettext by Santiago Vila |
280 | +# <sanvila@ctv.es> and octave by Dirk Eddelbuettel <edd@debian.org>. |
281 | + |
282 | +FLAVOR=$1 |
283 | +PACKAGE=xtrabackup |
284 | + |
285 | +if [ ${FLAVOR} = emacs ]; then exit 0; fi |
286 | + |
287 | +echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR} |
288 | + |
289 | +#FLAVORTEST=`echo $FLAVOR | cut -c-6` |
290 | +#if [ ${FLAVORTEST} = xemacs ] ; then |
291 | +# SITEFLAG="-no-site-file" |
292 | +#else |
293 | +# SITEFLAG="--no-site-file" |
294 | +#fi |
295 | +FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile" |
296 | + |
297 | +ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} |
298 | +ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} |
299 | + |
300 | +# Install-info-altdir does not actually exist. |
301 | +# Maybe somebody will write it. |
302 | +if test -x /usr/sbin/install-info-altdir; then |
303 | + echo install/${PACKAGE}: install Info links for ${FLAVOR} |
304 | + install-info-altdir --quiet --section "" "" --dirname=${FLAVOR} /usr/share/info/${PACKAGE}.info.gz |
305 | +fi |
306 | + |
307 | +install -m 755 -d ${ELCDIR} |
308 | +cd ${ELDIR} |
309 | +FILES=`echo *.el` |
310 | +cp ${FILES} ${ELCDIR} |
311 | +cd ${ELCDIR} |
312 | + |
313 | +cat << EOF > path.el |
314 | +(setq load-path (cons "." load-path) byte-compile-warnings nil) |
315 | +EOF |
316 | +${FLAVOR} ${FLAGS} ${FILES} |
317 | +rm -f *.el path.el |
318 | + |
319 | +exit 0 |
320 | |
321 | === added file 'utils/debian/emacsen-remove.ex' |
322 | --- utils/debian/emacsen-remove.ex 1970-01-01 00:00:00 +0000 |
323 | +++ utils/debian/emacsen-remove.ex 2010-08-10 17:17:44 +0000 |
324 | @@ -0,0 +1,15 @@ |
325 | +#!/bin/sh -e |
326 | +# /usr/lib/emacsen-common/packages/remove/xtrabackup |
327 | + |
328 | +FLAVOR=$1 |
329 | +PACKAGE=xtrabackup |
330 | + |
331 | +if [ ${FLAVOR} != emacs ]; then |
332 | + if test -x /usr/sbin/install-info-altdir; then |
333 | + echo remove/${PACKAGE}: removing Info links for ${FLAVOR} |
334 | + install-info-altdir --quiet --remove --dirname=${FLAVOR} /usr/share/info/xtrabackup.info.gz |
335 | + fi |
336 | + |
337 | + echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR} |
338 | + rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE} |
339 | +fi |
340 | |
341 | === added file 'utils/debian/emacsen-startup.ex' |
342 | --- utils/debian/emacsen-startup.ex 1970-01-01 00:00:00 +0000 |
343 | +++ utils/debian/emacsen-startup.ex 2010-08-10 17:17:44 +0000 |
344 | @@ -0,0 +1,25 @@ |
345 | +;; -*-emacs-lisp-*- |
346 | +;; |
347 | +;; Emacs startup file, e.g. /etc/emacs/site-start.d/50xtrabackup.el |
348 | +;; for the Debian xtrabackup package |
349 | +;; |
350 | +;; Originally contributed by Nils Naumann <naumann@unileoben.ac.at> |
351 | +;; Modified by Dirk Eddelbuettel <edd@debian.org> |
352 | +;; Adapted for dh-make by Jim Van Zandt <jrv@debian.org> |
353 | + |
354 | +;; The xtrabackup package follows the Debian/GNU Linux 'emacsen' policy and |
355 | +;; byte-compiles its elisp files for each 'emacs flavor' (emacs19, |
356 | +;; xemacs19, emacs20, xemacs20...). The compiled code is then |
357 | +;; installed in a subdirectory of the respective site-lisp directory. |
358 | +;; We have to add this to the load-path: |
359 | +(let ((package-dir (concat "/usr/share/" |
360 | + (symbol-name flavor) |
361 | + "/site-lisp/xtrabackup"))) |
362 | +;; If package-dir does not exist, the xtrabackup package must have |
363 | +;; removed but not purged, and we should skip the setup. |
364 | + (when (file-directory-p package-dir) |
365 | + (setq load-path (cons package-dir load-path)) |
366 | + (autoload 'xtrabackup-mode "xtrabackup-mode" |
367 | + "Major mode for editing xtrabackup files." t) |
368 | + (add-to-list 'auto-mode-alist '("\\.xtrabackup$" . xtrabackup-mode)))) |
369 | + |
370 | |
371 | === added file 'utils/debian/info' |
372 | --- utils/debian/info 1970-01-01 00:00:00 +0000 |
373 | +++ utils/debian/info 2010-08-10 17:17:44 +0000 |
374 | @@ -0,0 +1,1 @@ |
375 | +Docs/mysql.info |
376 | |
377 | === added file 'utils/debian/init.d.ex' |
378 | --- utils/debian/init.d.ex 1970-01-01 00:00:00 +0000 |
379 | +++ utils/debian/init.d.ex 2010-08-10 17:17:44 +0000 |
380 | @@ -0,0 +1,157 @@ |
381 | +#! /bin/sh |
382 | +# |
383 | +# skeleton example file to build /etc/init.d/ scripts. |
384 | +# This file should be used to construct scripts for /etc/init.d. |
385 | +# |
386 | +# Written by Miquel van Smoorenburg <miquels@cistron.nl>. |
387 | +# Modified for Debian |
388 | +# by Ian Murdock <imurdock@gnu.ai.mit.edu>. |
389 | +# Further changes by Javier Fernandez-Sanguino <jfs@debian.org> |
390 | +# |
391 | +# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl |
392 | +# |
393 | + |
394 | +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin |
395 | +DAEMON=/usr/sbin/xtrabackup |
396 | +NAME=xtrabackup |
397 | +DESC=xtrabackup |
398 | + |
399 | +test -x $DAEMON || exit 0 |
400 | + |
401 | +LOGDIR=/var/log/xtrabackup |
402 | +PIDFILE=/var/run/$NAME.pid |
403 | +DODTIME=1 # Time to wait for the server to die, in seconds |
404 | + # If this value is set too low you might not |
405 | + # let some servers to die gracefully and |
406 | + # 'restart' will not work |
407 | + |
408 | +# Include xtrabackup defaults if available |
409 | +if [ -f /etc/default/xtrabackup ] ; then |
410 | + . /etc/default/xtrabackup |
411 | +fi |
412 | + |
413 | +set -e |
414 | + |
415 | +running_pid() |
416 | +{ |
417 | + # Check if a given process pid's cmdline matches a given name |
418 | + pid=$1 |
419 | + name=$2 |
420 | + [ -z "$pid" ] && return 1 |
421 | + [ ! -d /proc/$pid ] && return 1 |
422 | + cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1` |
423 | + # Is this the expected child? |
424 | + [ "$cmd" != "$name" ] && return 1 |
425 | + return 0 |
426 | +} |
427 | + |
428 | +running() |
429 | +{ |
430 | +# Check if the process is running looking at /proc |
431 | +# (works for all users) |
432 | + |
433 | + # No pidfile, probably no daemon present |
434 | + [ ! -f "$PIDFILE" ] && return 1 |
435 | + # Obtain the pid and check it against the binary name |
436 | + pid=`cat $PIDFILE` |
437 | + running_pid $pid $DAEMON || return 1 |
438 | + return 0 |
439 | +} |
440 | + |
441 | +force_stop() { |
442 | +# Forcefully kill the process |
443 | + [ ! -f "$PIDFILE" ] && return |
444 | + if running ; then |
445 | + kill -15 $pid |
446 | + # Is it really dead? |
447 | + [ -n "$DODTIME" ] && sleep "$DODTIME"s |
448 | + if running ; then |
449 | + kill -9 $pid |
450 | + [ -n "$DODTIME" ] && sleep "$DODTIME"s |
451 | + if running ; then |
452 | + echo "Cannot kill $LABEL (pid=$pid)!" |
453 | + exit 1 |
454 | + fi |
455 | + fi |
456 | + fi |
457 | + rm -f $PIDFILE |
458 | + return 0 |
459 | +} |
460 | + |
461 | +case "$1" in |
462 | + start) |
463 | + echo -n "Starting $DESC: " |
464 | + start-stop-daemon --start --quiet --pidfile $PIDFILE \ |
465 | + --exec $DAEMON -- $DAEMON_OPTS |
466 | + if running ; then |
467 | + echo "$NAME." |
468 | + else |
469 | + echo " ERROR." |
470 | + fi |
471 | + ;; |
472 | + stop) |
473 | + echo -n "Stopping $DESC: " |
474 | + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ |
475 | + --exec $DAEMON |
476 | + echo "$NAME." |
477 | + ;; |
478 | + force-stop) |
479 | + echo -n "Forcefully stopping $DESC: " |
480 | + force_stop |
481 | + if ! running ; then |
482 | + echo "$NAME." |
483 | + else |
484 | + echo " ERROR." |
485 | + fi |
486 | + ;; |
487 | + #reload) |
488 | + # |
489 | + # If the daemon can reload its config files on the fly |
490 | + # for example by sending it SIGHUP, do it here. |
491 | + # |
492 | + # If the daemon responds to changes in its config file |
493 | + # directly anyway, make this a do-nothing entry. |
494 | + # |
495 | + # echo "Reloading $DESC configuration files." |
496 | + # start-stop-daemon --stop --signal 1 --quiet --pidfile \ |
497 | + # /var/run/$NAME.pid --exec $DAEMON |
498 | + #;; |
499 | + force-reload) |
500 | + # |
501 | + # If the "reload" option is implemented, move the "force-reload" |
502 | + # option to the "reload" entry above. If not, "force-reload" is |
503 | + # just the same as "restart" except that it does nothing if the |
504 | + # daemon isn't already running. |
505 | + # check wether $DAEMON is running. If so, restart |
506 | + start-stop-daemon --stop --test --quiet --pidfile \ |
507 | + /var/run/$NAME.pid --exec $DAEMON \ |
508 | + && $0 restart \ |
509 | + || exit 0 |
510 | + ;; |
511 | + restart) |
512 | + echo -n "Restarting $DESC: " |
513 | + start-stop-daemon --stop --quiet --pidfile \ |
514 | + /var/run/$NAME.pid --exec $DAEMON |
515 | + [ -n "$DODTIME" ] && sleep $DODTIME |
516 | + start-stop-daemon --start --quiet --pidfile \ |
517 | + /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS |
518 | + echo "$NAME." |
519 | + ;; |
520 | + status) |
521 | + echo -n "$LABEL is " |
522 | + if running ; then |
523 | + echo "running" |
524 | + else |
525 | + echo " not running." |
526 | + exit 1 |
527 | + fi |
528 | + ;; |
529 | + *) |
530 | + N=/etc/init.d/$NAME |
531 | + # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 |
532 | + echo "Usage: $N {start|stop|restart|force-reload|status|force-stop}" >&2 |
533 | + exit 1 |
534 | + ;; |
535 | +esac |
536 | + |
537 | +exit 0 |
538 | |
539 | === added file 'utils/debian/init.d.lsb.ex' |
540 | --- utils/debian/init.d.lsb.ex 1970-01-01 00:00:00 +0000 |
541 | +++ utils/debian/init.d.lsb.ex 2010-08-10 17:17:44 +0000 |
542 | @@ -0,0 +1,296 @@ |
543 | +#!/bin/sh |
544 | +# |
545 | +# Example init.d script with LSB support. |
546 | +# |
547 | +# Please read this init.d carefully and modify the sections to |
548 | +# adjust it to the program you want to run. |
549 | +# |
550 | +# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org> |
551 | +# |
552 | +# This is free software; you may redistribute it and/or modify |
553 | +# it under the terms of the GNU General Public License as |
554 | +# published by the Free Software Foundation; either version 2, |
555 | +# or (at your option) any later version. |
556 | +# |
557 | +# This is distributed in the hope that it will be useful, but |
558 | +# WITHOUT ANY WARRANTY; without even the implied warranty of |
559 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
560 | +# GNU General Public License for more details. |
561 | +# |
562 | +# You should have received a copy of the GNU General Public License with |
563 | +# the Debian operating system, in /usr/share/common-licenses/GPL; if |
564 | +# not, write to the Free Software Foundation, Inc., 59 Temple Place, |
565 | +# Suite 330, Boston, MA 02111-1307 USA |
566 | +# |
567 | +### BEGIN INIT INFO |
568 | +# Provides: xtrabackup |
569 | +# Required-Start: $network $local_fs |
570 | +# Required-Stop: |
571 | +# Should-Start: $named |
572 | +# Should-Stop: |
573 | +# Default-Start: 2 3 4 5 |
574 | +# Default-Stop: 0 1 6 |
575 | +# Short-Description: <Enter a short description of the sortware> |
576 | +# Description: <Enter a long description of the software> |
577 | +# <...> |
578 | +# <...> |
579 | +### END INIT INFO |
580 | + |
581 | +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin |
582 | + |
583 | +DAEMON=/usr/sbin/xtrabackup # Introduce the server's location here |
584 | +NAME=#PACKAGE # Introduce the short server's name here |
585 | +DESC=#PACKAGE # Introduce a short description here |
586 | +LOGDIR=/var/log/xtrabackup # Log directory to use |
587 | + |
588 | +PIDFILE=/var/run/$NAME.pid |
589 | + |
590 | +test -x $DAEMON || exit 0 |
591 | + |
592 | +. /lib/lsb/init-functions |
593 | + |
594 | +# Default options, these can be overriden by the information |
595 | +# at /etc/default/$NAME |
596 | +DAEMON_OPTS="" # Additional options given to the server |
597 | + |
598 | +DIETIME=10 # Time to wait for the server to die, in seconds |
599 | + # If this value is set too low you might not |
600 | + # let some servers to die gracefully and |
601 | + # 'restart' will not work |
602 | + |
603 | +#STARTTIME=2 # Time to wait for the server to start, in seconds |
604 | + # If this value is set each time the server is |
605 | + # started (on start or restart) the script will |
606 | + # stall to try to determine if it is running |
607 | + # If it is not set and the server takes time |
608 | + # to setup a pid file the log message might |
609 | + # be a false positive (says it did not start |
610 | + # when it actually did) |
611 | + |
612 | +LOGFILE=$LOGDIR/$NAME.log # Server logfile |
613 | +#DAEMONUSER=xtrabackup # Users to run the daemons as. If this value |
614 | + # is set start-stop-daemon will chuid the server |
615 | + |
616 | +# Include defaults if available |
617 | +if [ -f /etc/default/$NAME ] ; then |
618 | + . /etc/default/$NAME |
619 | +fi |
620 | + |
621 | +# Use this if you want the user to explicitly set 'RUN' in |
622 | +# /etc/default/ |
623 | +#if [ "x$RUN" != "xyes" ] ; then |
624 | +# log_failure_msg "$NAME disabled, please adjust the configuration to your needs " |
625 | +# log_failure_msg "and then set RUN to 'yes' in /etc/default/$NAME to enable it." |
626 | +# exit 1 |
627 | +#fi |
628 | + |
629 | +# Check that the user exists (if we set a user) |
630 | +# Does the user exist? |
631 | +if [ -n "$DAEMONUSER" ] ; then |
632 | + if getent passwd | grep -q "^$DAEMONUSER:"; then |
633 | + # Obtain the uid and gid |
634 | + DAEMONUID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $3}'` |
635 | + DAEMONGID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $4}'` |
636 | + else |
637 | + log_failure_msg "The user $DAEMONUSER, required to run $NAME does not exist." |
638 | + exit 1 |
639 | + fi |
640 | +fi |
641 | + |
642 | + |
643 | +set -e |
644 | + |
645 | +running_pid() { |
646 | +# Check if a given process pid's cmdline matches a given name |
647 | + pid=$1 |
648 | + name=$2 |
649 | + [ -z "$pid" ] && return 1 |
650 | + [ ! -d /proc/$pid ] && return 1 |
651 | + cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1` |
652 | + # Is this the expected server |
653 | + [ "$cmd" != "$name" ] && return 1 |
654 | + return 0 |
655 | +} |
656 | + |
657 | +running() { |
658 | +# Check if the process is running looking at /proc |
659 | +# (works for all users) |
660 | + |
661 | + # No pidfile, probably no daemon present |
662 | + [ ! -f "$PIDFILE" ] && return 1 |
663 | + pid=`cat $PIDFILE` |
664 | + running_pid $pid $DAEMON || return 1 |
665 | + return 0 |
666 | +} |
667 | + |
668 | +start_server() { |
669 | +# Start the process using the wrapper |
670 | + if [ -z "$DAEMONUSER" ] ; then |
671 | + start_daemon -p $PIDFILE $DAEMON -- $DAEMON_OPTS |
672 | + errcode=$? |
673 | + else |
674 | +# if we are using a daemonuser then change the user id |
675 | + start-stop-daemon --start --quiet --pidfile $PIDFILE \ |
676 | + --chuid $DAEMONUSER \ |
677 | + --exec $DAEMON -- $DAEMON_OPTS |
678 | + errcode=$? |
679 | + fi |
680 | + return $errcode |
681 | +} |
682 | + |
683 | +stop_server() { |
684 | +# Stop the process using the wrapper |
685 | + if [ -z "$DAEMONUSER" ] ; then |
686 | + killproc -p $PIDFILE $DAEMON |
687 | + errcode=$? |
688 | + else |
689 | +# if we are using a daemonuser then look for process that match |
690 | + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ |
691 | + --user $DAEMONUSER \ |
692 | + --exec $DAEMON |
693 | + errcode=$? |
694 | + fi |
695 | + |
696 | + return $errcode |
697 | +} |
698 | + |
699 | +reload_server() { |
700 | + [ ! -f "$PIDFILE" ] && return 1 |
701 | + pid=pidofproc $PIDFILE # This is the daemon's pid |
702 | + # Send a SIGHUP |
703 | + kill -1 $pid |
704 | + return $? |
705 | +} |
706 | + |
707 | +force_stop() { |
708 | +# Force the process to die killing it manually |
709 | + [ ! -e "$PIDFILE" ] && return |
710 | + if running ; then |
711 | + kill -15 $pid |
712 | + # Is it really dead? |
713 | + sleep "$DIETIME"s |
714 | + if running ; then |
715 | + kill -9 $pid |
716 | + sleep "$DIETIME"s |
717 | + if running ; then |
718 | + echo "Cannot kill $NAME (pid=$pid)!" |
719 | + exit 1 |
720 | + fi |
721 | + fi |
722 | + fi |
723 | + rm -f $PIDFILE |
724 | +} |
725 | + |
726 | + |
727 | +case "$1" in |
728 | + start) |
729 | + log_daemon_msg "Starting $DESC " "$NAME" |
730 | + # Check if it's running first |
731 | + if running ; then |
732 | + log_progress_msg "apparently already running" |
733 | + log_end_msg 0 |
734 | + exit 0 |
735 | + fi |
736 | + if start_server ; then |
737 | + # NOTE: Some servers might die some time after they start, |
738 | + # this code will detect this issue if STARTTIME is set |
739 | + # to a reasonable value |
740 | + [ -n "$STARTTIME" ] && sleep $STARTTIME # Wait some time |
741 | + if running ; then |
742 | + # It's ok, the server started and is running |
743 | + log_end_msg 0 |
744 | + else |
745 | + # It is not running after we did start |
746 | + log_end_msg 1 |
747 | + fi |
748 | + else |
749 | + # Either we could not start it |
750 | + log_end_msg 1 |
751 | + fi |
752 | + ;; |
753 | + stop) |
754 | + log_daemon_msg "Stopping $DESC" "$NAME" |
755 | + if running ; then |
756 | + # Only stop the server if we see it running |
757 | + errcode=0 |
758 | + stop_server || errcode=$? |
759 | + log_end_msg $errcode |
760 | + else |
761 | + # If it's not running don't do anything |
762 | + log_progress_msg "apparently not running" |
763 | + log_end_msg 0 |
764 | + exit 0 |
765 | + fi |
766 | + ;; |
767 | + force-stop) |
768 | + # First try to stop gracefully the program |
769 | + $0 stop |
770 | + if running; then |
771 | + # If it's still running try to kill it more forcefully |
772 | + log_daemon_msg "Stopping (force) $DESC" "$NAME" |
773 | + errcode=0 |
774 | + force_stop || errcode=$? |
775 | + log_end_msg $errcode |
776 | + fi |
777 | + ;; |
778 | + restart|force-reload) |
779 | + log_daemon_msg "Restarting $DESC" "$NAME" |
780 | + errcode=0 |
781 | + stop_server || errcode=$? |
782 | + # Wait some sensible amount, some server need this |
783 | + [ -n "$DIETIME" ] && sleep $DIETIME |
784 | + start_server || errcode=$? |
785 | + [ -n "$STARTTIME" ] && sleep $STARTTIME |
786 | + running || errcode=$? |
787 | + log_end_msg $errcode |
788 | + ;; |
789 | + status) |
790 | + |
791 | + log_daemon_msg "Checking status of $DESC" "$NAME" |
792 | + if running ; then |
793 | + log_progress_msg "running" |
794 | + log_end_msg 0 |
795 | + else |
796 | + log_progress_msg "apparently not running" |
797 | + log_end_msg 1 |
798 | + exit 1 |
799 | + fi |
800 | + ;; |
801 | + # Use this if the daemon cannot reload |
802 | + reload) |
803 | + log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon" |
804 | + log_warning_msg "cannot re-read the config file (use restart)." |
805 | + ;; |
806 | + # And this if it cann |
807 | + #reload) |
808 | + # |
809 | + # If the daemon can reload its config files on the fly |
810 | + # for example by sending it SIGHUP, do it here. |
811 | + # |
812 | + # If the daemon responds to changes in its config file |
813 | + # directly anyway, make this a do-nothing entry. |
814 | + # |
815 | + # log_daemon_msg "Reloading $DESC configuration files" "$NAME" |
816 | + # if running ; then |
817 | + # reload_server |
818 | + # if ! running ; then |
819 | + # Process died after we tried to reload |
820 | + # log_progress_msg "died on reload" |
821 | + # log_end_msg 1 |
822 | + # exit 1 |
823 | + # fi |
824 | + # else |
825 | + # log_progress_msg "server is not running" |
826 | + # log_end_msg 1 |
827 | + # exit 1 |
828 | + # fi |
829 | + #;; |
830 | + |
831 | + *) |
832 | + N=/etc/init.d/$NAME |
833 | + echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2 |
834 | + exit 1 |
835 | + ;; |
836 | +esac |
837 | + |
838 | +exit 0 |
839 | |
840 | === added file 'utils/debian/manpage.1.ex' |
841 | --- utils/debian/manpage.1.ex 1970-01-01 00:00:00 +0000 |
842 | +++ utils/debian/manpage.1.ex 2010-08-10 17:17:44 +0000 |
843 | @@ -0,0 +1,59 @@ |
844 | +.\" Hey, EMACS: -*- nroff -*- |
845 | +.\" First parameter, NAME, should be all caps |
846 | +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection |
847 | +.\" other parameters are allowed: see man(7), man(1) |
848 | +.TH XTRABACKUP SECTION "June 28, 2009" |
849 | +.\" Please adjust this date whenever revising the manpage. |
850 | +.\" |
851 | +.\" Some roff macros, for reference: |
852 | +.\" .nh disable hyphenation |
853 | +.\" .hy enable hyphenation |
854 | +.\" .ad l left justify |
855 | +.\" .ad b justify to both left and right margins |
856 | +.\" .nf disable filling |
857 | +.\" .fi enable filling |
858 | +.\" .br insert line break |
859 | +.\" .sp <n> insert n+1 empty lines |
860 | +.\" for manpage-specific macros, see man(7) |
861 | +.SH NAME |
862 | +xtrabackup \- program to do something |
863 | +.SH SYNOPSIS |
864 | +.B xtrabackup |
865 | +.RI [ options ] " files" ... |
866 | +.br |
867 | +.B bar |
868 | +.RI [ options ] " files" ... |
869 | +.SH DESCRIPTION |
870 | +This manual page documents briefly the |
871 | +.B xtrabackup |
872 | +and |
873 | +.B bar |
874 | +commands. |
875 | +.PP |
876 | +.\" TeX users may be more comfortable with the \fB<whatever>\fP and |
877 | +.\" \fI<whatever>\fP escape sequences to invode bold face and italics, |
878 | +.\" respectively. |
879 | +\fBxtrabackup\fP is a program that... |
880 | +.SH OPTIONS |
881 | +These programs follow the usual GNU command line syntax, with long |
882 | +options starting with two dashes (`-'). |
883 | +A summary of options is included below. |
884 | +For a complete description, see the Info files. |
885 | +.TP |
886 | +.B \-h, \-\-help |
887 | +Show summary of options. |
888 | +.TP |
889 | +.B \-v, \-\-version |
890 | +Show version of program. |
891 | +.SH SEE ALSO |
892 | +.BR bar (1), |
893 | +.BR baz (1). |
894 | +.br |
895 | +The programs are documented fully by |
896 | +.IR "The Rise and Fall of a Fooish Bar" , |
897 | +available via the Info system. |
898 | +.SH AUTHOR |
899 | +xtrabackup was written by <upstream author>. |
900 | +.PP |
901 | +This manual page was written by Alex <aleksandr.kuzminsky@percona.com>, |
902 | +for the Debian project (but may be used by others). |
903 | |
904 | === added file 'utils/debian/manpage.sgml.ex' |
905 | --- utils/debian/manpage.sgml.ex 1970-01-01 00:00:00 +0000 |
906 | +++ utils/debian/manpage.sgml.ex 2010-08-10 17:17:44 +0000 |
907 | @@ -0,0 +1,156 @@ |
908 | +<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [ |
909 | + |
910 | +<!-- Process this file with docbook-to-man to generate an nroff manual |
911 | + page: `docbook-to-man manpage.sgml > manpage.1'. You may view |
912 | + the manual page with: `docbook-to-man manpage.sgml | nroff -man | |
913 | + less'. A typical entry in a Makefile or Makefile.am is: |
914 | + |
915 | +manpage.1: manpage.sgml |
916 | + docbook-to-man $< > $@ |
917 | + |
918 | + |
919 | + The docbook-to-man binary is found in the docbook-to-man package. |
920 | + Please remember that if you create the nroff version in one of the |
921 | + debian/rules file targets (such as build), you will need to include |
922 | + docbook-to-man in your Build-Depends control field. |
923 | + |
924 | + --> |
925 | + |
926 | + <!-- Fill in your name for FIRSTNAME and SURNAME. --> |
927 | + <!ENTITY dhfirstname "<firstname>FIRSTNAME</firstname>"> |
928 | + <!ENTITY dhsurname "<surname>SURNAME</surname>"> |
929 | + <!-- Please adjust the date whenever revising the manpage. --> |
930 | + <!ENTITY dhdate "<date>June 28, 2009</date>"> |
931 | + <!-- SECTION should be 1-8, maybe w/ subsection other parameters are |
932 | + allowed: see man(7), man(1). --> |
933 | + <!ENTITY dhsection "<manvolnum>SECTION</manvolnum>"> |
934 | + <!ENTITY dhemail "<email>aleksandr.kuzminsky@percona.com</email>"> |
935 | + <!ENTITY dhusername "Alex"> |
936 | + <!ENTITY dhucpackage "<refentrytitle>XTRABACKUP</refentrytitle>"> |
937 | + <!ENTITY dhpackage "xtrabackup"> |
938 | + |
939 | + <!ENTITY debian "<productname>Debian</productname>"> |
940 | + <!ENTITY gnu "<acronym>GNU</acronym>"> |
941 | + <!ENTITY gpl "&gnu; <acronym>GPL</acronym>"> |
942 | +]> |
943 | + |
944 | +<refentry> |
945 | + <refentryinfo> |
946 | + <address> |
947 | + &dhemail; |
948 | + </address> |
949 | + <author> |
950 | + &dhfirstname; |
951 | + &dhsurname; |
952 | + </author> |
953 | + <copyright> |
954 | + <year>2003</year> |
955 | + <holder>&dhusername;</holder> |
956 | + </copyright> |
957 | + &dhdate; |
958 | + </refentryinfo> |
959 | + <refmeta> |
960 | + &dhucpackage; |
961 | + |
962 | + &dhsection; |
963 | + </refmeta> |
964 | + <refnamediv> |
965 | + <refname>&dhpackage;</refname> |
966 | + |
967 | + <refpurpose>program to do something</refpurpose> |
968 | + </refnamediv> |
969 | + <refsynopsisdiv> |
970 | + <cmdsynopsis> |
971 | + <command>&dhpackage;</command> |
972 | + |
973 | + <arg><option>-e <replaceable>this</replaceable></option></arg> |
974 | + |
975 | + <arg><option>--example <replaceable>that</replaceable></option></arg> |
976 | + </cmdsynopsis> |
977 | + </refsynopsisdiv> |
978 | + <refsect1> |
979 | + <title>DESCRIPTION</title> |
980 | + |
981 | + <para>This manual page documents briefly the |
982 | + <command>&dhpackage;</command> and <command>bar</command> |
983 | + commands.</para> |
984 | + |
985 | + <para>This manual page was written for the &debian; distribution |
986 | + because the original program does not have a manual page. |
987 | + Instead, it has documentation in the &gnu; |
988 | + <application>Info</application> format; see below.</para> |
989 | + |
990 | + <para><command>&dhpackage;</command> is a program that...</para> |
991 | + |
992 | + </refsect1> |
993 | + <refsect1> |
994 | + <title>OPTIONS</title> |
995 | + |
996 | + <para>These programs follow the usual &gnu; command line syntax, |
997 | + with long options starting with two dashes (`-'). A summary of |
998 | + options is included below. For a complete description, see the |
999 | + <application>Info</application> files.</para> |
1000 | + |
1001 | + <variablelist> |
1002 | + <varlistentry> |
1003 | + <term><option>-h</option> |
1004 | + <option>--help</option> |
1005 | + </term> |
1006 | + <listitem> |
1007 | + <para>Show summary of options.</para> |
1008 | + </listitem> |
1009 | + </varlistentry> |
1010 | + <varlistentry> |
1011 | + <term><option>-v</option> |
1012 | + <option>--version</option> |
1013 | + </term> |
1014 | + <listitem> |
1015 | + <para>Show version of program.</para> |
1016 | + </listitem> |
1017 | + </varlistentry> |
1018 | + </variablelist> |
1019 | + </refsect1> |
1020 | + <refsect1> |
1021 | + <title>SEE ALSO</title> |
1022 | + |
1023 | + <para>bar (1), baz (1).</para> |
1024 | + |
1025 | + <para>The programs are documented fully by <citetitle>The Rise and |
1026 | + Fall of a Fooish Bar</citetitle> available via the |
1027 | + <application>Info</application> system.</para> |
1028 | + </refsect1> |
1029 | + <refsect1> |
1030 | + <title>AUTHOR</title> |
1031 | + |
1032 | + <para>This manual page was written by &dhusername; &dhemail; for |
1033 | + the &debian; system (but may be used by others). Permission is |
1034 | + granted to copy, distribute and/or modify this document under |
1035 | + the terms of the &gnu; General Public License, Version 2 any |
1036 | + later version published by the Free Software Foundation. |
1037 | + </para> |
1038 | + <para> |
1039 | + On Debian systems, the complete text of the GNU General Public |
1040 | + License can be found in /usr/share/common-licenses/GPL. |
1041 | + </para> |
1042 | + |
1043 | + </refsect1> |
1044 | +</refentry> |
1045 | + |
1046 | +<!-- Keep this comment at the end of the file |
1047 | +Local variables: |
1048 | +mode: sgml |
1049 | +sgml-omittag:t |
1050 | +sgml-shorttag:t |
1051 | +sgml-minimize-attributes:nil |
1052 | +sgml-always-quote-attributes:t |
1053 | +sgml-indent-step:2 |
1054 | +sgml-indent-data:t |
1055 | +sgml-parent-document:nil |
1056 | +sgml-default-dtd-file:nil |
1057 | +sgml-exposed-tags:nil |
1058 | +sgml-local-catalogs:nil |
1059 | +sgml-local-ecat-files:nil |
1060 | +End: |
1061 | +--> |
1062 | + |
1063 | + |
1064 | |
1065 | === added file 'utils/debian/manpage.xml.ex' |
1066 | --- utils/debian/manpage.xml.ex 1970-01-01 00:00:00 +0000 |
1067 | +++ utils/debian/manpage.xml.ex 2010-08-10 17:17:44 +0000 |
1068 | @@ -0,0 +1,291 @@ |
1069 | +<?xml version='1.0' encoding='UTF-8'?> |
1070 | +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
1071 | +"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ |
1072 | + |
1073 | +<!-- |
1074 | + |
1075 | +`xsltproc -''-nonet \ |
1076 | + -''-param man.charmap.use.subset "0" \ |
1077 | + -''-param make.year.ranges "1" \ |
1078 | + -''-param make.single.year.ranges "1" \ |
1079 | + /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl \ |
1080 | + manpage.xml' |
1081 | + |
1082 | +A manual page <package>.<section> will be generated. You may view the |
1083 | +manual page with: nroff -man <package>.<section> | less'. A typical entry |
1084 | +in a Makefile or Makefile.am is: |
1085 | + |
1086 | +DB2MAN = /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl |
1087 | +XP = xsltproc -''-nonet -''-param man.charmap.use.subset "0" |
1088 | + |
1089 | +manpage.1: manpage.xml |
1090 | + $(XP) $(DB2MAN) $< |
1091 | + |
1092 | +The xsltproc binary is found in the xsltproc package. The XSL files are in |
1093 | +docbook-xsl. A description of the parameters you can use can be found in the |
1094 | +docbook-xsl-doc-* packages. Please remember that if you create the nroff |
1095 | +version in one of the debian/rules file targets (such as build), you will need |
1096 | +to include xsltproc and docbook-xsl in your Build-Depends control field. |
1097 | +Alternatively use the xmlto command/package. That will also automatically |
1098 | +pull in xsltproc and docbook-xsl. |
1099 | + |
1100 | +Notes for using docbook2x: docbook2x-man does not automatically create the |
1101 | +AUTHOR(S) and COPYRIGHT sections. In this case, please add them manually as |
1102 | +<refsect1> ... </refsect1>. |
1103 | + |
1104 | +To disable the automatic creation of the AUTHOR(S) and COPYRIGHT sections |
1105 | +read /usr/share/doc/docbook-xsl/doc/manpages/authors.html. This file can be |
1106 | +found in the docbook-xsl-doc-html package. |
1107 | + |
1108 | +Validation can be done using: `xmllint -''-noout -''-valid manpage.xml` |
1109 | + |
1110 | +General documentation about man-pages and man-page-formatting: |
1111 | +man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/ |
1112 | + |
1113 | +--> |
1114 | + |
1115 | + <!-- Fill in your name for FIRSTNAME and SURNAME. --> |
1116 | + <!ENTITY dhfirstname "FIRSTNAME"> |
1117 | + <!ENTITY dhsurname "SURNAME"> |
1118 | + <!-- dhusername could also be set to "&firstname; &surname;". --> |
1119 | + <!ENTITY dhusername "Alex"> |
1120 | + <!ENTITY dhemail "aleksandr.kuzminsky@percona.com"> |
1121 | + <!-- SECTION should be 1-8, maybe w/ subsection other parameters are |
1122 | + allowed: see man(7), man(1) and |
1123 | + http://www.tldp.org/HOWTO/Man-Page/q2.html. --> |
1124 | + <!ENTITY dhsection "SECTION"> |
1125 | + <!-- TITLE should be something like "User commands" or similar (see |
1126 | + http://www.tldp.org/HOWTO/Man-Page/q2.html). --> |
1127 | + <!ENTITY dhtitle "xtrabackup User Manual"> |
1128 | + <!ENTITY dhucpackage "XTRABACKUP"> |
1129 | + <!ENTITY dhpackage "xtrabackup"> |
1130 | +]> |
1131 | + |
1132 | +<refentry> |
1133 | + <refentryinfo> |
1134 | + <title>&dhtitle;</title> |
1135 | + <productname>&dhpackage;</productname> |
1136 | + <authorgroup> |
1137 | + <author> |
1138 | + <firstname>&dhfirstname;</firstname> |
1139 | + <surname>&dhsurname;</surname> |
1140 | + <contrib>Wrote this manpage for the Debian system.</contrib> |
1141 | + <address> |
1142 | + <email>&dhemail;</email> |
1143 | + </address> |
1144 | + </author> |
1145 | + </authorgroup> |
1146 | + <copyright> |
1147 | + <year>2007</year> |
1148 | + <holder>&dhusername;</holder> |
1149 | + </copyright> |
1150 | + <legalnotice> |
1151 | + <para>This manual page was written for the Debian system |
1152 | + (but may be used by others).</para> |
1153 | + <para>Permission is granted to copy, distribute and/or modify this |
1154 | + document under the terms of the GNU General Public License, |
1155 | + Version 2 or (at your option) any later version published by |
1156 | + the Free Software Foundation.</para> |
1157 | + <para>On Debian systems, the complete text of the GNU General Public |
1158 | + License can be found in |
1159 | + <filename>/usr/share/common-licenses/GPL</filename>.</para> |
1160 | + </legalnotice> |
1161 | + </refentryinfo> |
1162 | + <refmeta> |
1163 | + <refentrytitle>&dhucpackage;</refentrytitle> |
1164 | + <manvolnum>&dhsection;</manvolnum> |
1165 | + </refmeta> |
1166 | + <refnamediv> |
1167 | + <refname>&dhpackage;</refname> |
1168 | + <refpurpose>program to do something</refpurpose> |
1169 | + </refnamediv> |
1170 | + <refsynopsisdiv> |
1171 | + <cmdsynopsis> |
1172 | + <command>&dhpackage;</command> |
1173 | + <!-- These are several examples, how syntaxes could look --> |
1174 | + <arg choice="plain"><option>-e <replaceable>this</replaceable></option></arg> |
1175 | + <arg choice="opt"><option>--example=<parameter>that</parameter></option></arg> |
1176 | + <arg choice="opt"> |
1177 | + <group choice="req"> |
1178 | + <arg choice="plain"><option>-e</option></arg> |
1179 | + <arg choice="plain"><option>--example</option></arg> |
1180 | + </group> |
1181 | + <replaceable class="option">this</replaceable> |
1182 | + </arg> |
1183 | + <arg choice="opt"> |
1184 | + <group choice="req"> |
1185 | + <arg choice="plain"><option>-e</option></arg> |
1186 | + <arg choice="plain"><option>--example</option></arg> |
1187 | + </group> |
1188 | + <group choice="req"> |
1189 | + <arg choice="plain"><replaceable>this</replaceable></arg> |
1190 | + <arg choice="plain"><replaceable>that</replaceable></arg> |
1191 | + </group> |
1192 | + </arg> |
1193 | + </cmdsynopsis> |
1194 | + <cmdsynopsis> |
1195 | + <command>&dhpackage;</command> |
1196 | + <!-- Normally the help and version options make the programs stop |
1197 | + right after outputting the requested information. --> |
1198 | + <group choice="opt"> |
1199 | + <arg choice="plain"> |
1200 | + <group choice="req"> |
1201 | + <arg choice="plain"><option>-h</option></arg> |
1202 | + <arg choice="plain"><option>--help</option></arg> |
1203 | + </group> |
1204 | + </arg> |
1205 | + <arg choice="plain"> |
1206 | + <group choice="req"> |
1207 | + <arg choice="plain"><option>-v</option></arg> |
1208 | + <arg choice="plain"><option>--version</option></arg> |
1209 | + </group> |
1210 | + </arg> |
1211 | + </group> |
1212 | + </cmdsynopsis> |
1213 | + </refsynopsisdiv> |
1214 | + <refsect1 id="description"> |
1215 | + <title>DESCRIPTION</title> |
1216 | + <para>This manual page documents briefly the |
1217 | + <command>&dhpackage;</command> and <command>bar</command> |
1218 | + commands.</para> |
1219 | + <para>This manual page was written for the Debian distribution |
1220 | + because the original program does not have a manual page. |
1221 | + Instead, it has documentation in the GNU <citerefentry> |
1222 | + <refentrytitle>info</refentrytitle> |
1223 | + <manvolnum>1</manvolnum> |
1224 | + </citerefentry> format; see below.</para> |
1225 | + <para><command>&dhpackage;</command> is a program that...</para> |
1226 | + </refsect1> |
1227 | + <refsect1 id="options"> |
1228 | + <title>OPTIONS</title> |
1229 | + <para>The program follows the usual GNU command line syntax, |
1230 | + with long options starting with two dashes (`-'). A summary of |
1231 | + options is included below. For a complete description, see the |
1232 | + <citerefentry> |
1233 | + <refentrytitle>info</refentrytitle> |
1234 | + <manvolnum>1</manvolnum> |
1235 | + </citerefentry> files.</para> |
1236 | + <variablelist> |
1237 | + <!-- Use the variablelist.term.separator and the |
1238 | + variablelist.term.break.after parameters to |
1239 | + control the term elements. --> |
1240 | + <varlistentry> |
1241 | + <term><option>-e <replaceable>this</replaceable></option></term> |
1242 | + <term><option>--example=<replaceable>that</replaceable></option></term> |
1243 | + <listitem> |
1244 | + <para>Does this and that.</para> |
1245 | + </listitem> |
1246 | + </varlistentry> |
1247 | + <varlistentry> |
1248 | + <term><option>-h</option></term> |
1249 | + <term><option>--help</option></term> |
1250 | + <listitem> |
1251 | + <para>Show summary of options.</para> |
1252 | + </listitem> |
1253 | + </varlistentry> |
1254 | + <varlistentry> |
1255 | + <term><option>-v</option></term> |
1256 | + <term><option>--version</option></term> |
1257 | + <listitem> |
1258 | + <para>Show version of program.</para> |
1259 | + </listitem> |
1260 | + </varlistentry> |
1261 | + </variablelist> |
1262 | + </refsect1> |
1263 | + <refsect1 id="files"> |
1264 | + <title>FILES</title> |
1265 | + <variablelist> |
1266 | + <varlistentry> |
1267 | + <term><filename>/etc/foo.conf</filename></term> |
1268 | + <listitem> |
1269 | + <para>The system-wide configuration file to control the |
1270 | + behaviour of <application>&dhpackage;</application>. See |
1271 | + <citerefentry> |
1272 | + <refentrytitle>foo.conf</refentrytitle> |
1273 | + <manvolnum>5</manvolnum> |
1274 | + </citerefentry> for further details.</para> |
1275 | + </listitem> |
1276 | + </varlistentry> |
1277 | + <varlistentry> |
1278 | + <term><filename>${HOME}/.foo.conf</filename></term> |
1279 | + <listitem> |
1280 | + <para>The per-user configuration file to control the |
1281 | + behaviour of <application>&dhpackage;</application>. See |
1282 | + <citerefentry> |
1283 | + <refentrytitle>foo.conf</refentrytitle> |
1284 | + <manvolnum>5</manvolnum> |
1285 | + </citerefentry> for further details.</para> |
1286 | + </listitem> |
1287 | + </varlistentry> |
1288 | + </variablelist> |
1289 | + </refsect1> |
1290 | + <refsect1 id="environment"> |
1291 | + <title>ENVIONMENT</title> |
1292 | + <variablelist> |
1293 | + <varlistentry> |
1294 | + <term><envar>FOO_CONF</envar></term> |
1295 | + <listitem> |
1296 | + <para>If used, the defined file is used as configuration |
1297 | + file (see also <xref linkend="files"/>).</para> |
1298 | + </listitem> |
1299 | + </varlistentry> |
1300 | + </variablelist> |
1301 | + </refsect1> |
1302 | + <refsect1 id="diagnostics"> |
1303 | + <title>DIAGNOSTICS</title> |
1304 | + <para>The following diagnostics may be issued |
1305 | + on <filename class="devicefile">stderr</filename>:</para> |
1306 | + <variablelist> |
1307 | + <varlistentry> |
1308 | + <term><errortext>Bad configuration file. Exiting.</errortext></term> |
1309 | + <listitem> |
1310 | + <para>The configuration file seems to contain a broken configuration |
1311 | + line. Use the <option>--verbose</option> option, to get more info. |
1312 | + </para> |
1313 | + </listitem> |
1314 | + </varlistentry> |
1315 | + </variablelist> |
1316 | + <para><command>&dhpackage;</command> provides some return codes, that can |
1317 | + be used in scripts:</para> |
1318 | + <segmentedlist> |
1319 | + <segtitle>Code</segtitle> |
1320 | + <segtitle>Diagnostic</segtitle> |
1321 | + <seglistitem> |
1322 | + <seg><errorcode>0</errorcode></seg> |
1323 | + <seg>Program exited successfully.</seg> |
1324 | + </seglistitem> |
1325 | + <seglistitem> |
1326 | + <seg><errorcode>1</errorcode></seg> |
1327 | + <seg>The configuration file seems to be broken.</seg> |
1328 | + </seglistitem> |
1329 | + </segmentedlist> |
1330 | + </refsect1> |
1331 | + <refsect1 id="bugs"> |
1332 | + <!-- Or use this section to tell about upstream BTS. --> |
1333 | + <title>BUGS</title> |
1334 | + <para>The program is currently limited to only work |
1335 | + with the <package>foobar</package> library.</para> |
1336 | + <para>The upstreams <acronym>BTS</acronym> can be found |
1337 | + at <ulink url="http://bugzilla.foo.tld"/>.</para> |
1338 | + </refsect1> |
1339 | + <refsect1 id="see_also"> |
1340 | + <title>SEE ALSO</title> |
1341 | + <!-- In alpabetical order. --> |
1342 | + <para><citerefentry> |
1343 | + <refentrytitle>bar</refentrytitle> |
1344 | + <manvolnum>1</manvolnum> |
1345 | + </citerefentry>, <citerefentry> |
1346 | + <refentrytitle>baz</refentrytitle> |
1347 | + <manvolnum>1</manvolnum> |
1348 | + </citerefentry>, <citerefentry> |
1349 | + <refentrytitle>foo.conf</refentrytitle> |
1350 | + <manvolnum>5</manvolnum> |
1351 | + </citerefentry></para> |
1352 | + <para>The programs are documented fully by <citetitle>The Rise and |
1353 | + Fall of a Fooish Bar</citetitle> available via the <citerefentry> |
1354 | + <refentrytitle>info</refentrytitle> |
1355 | + <manvolnum>1</manvolnum> |
1356 | + </citerefentry> system.</para> |
1357 | + </refsect1> |
1358 | +</refentry> |
1359 | + |
1360 | |
1361 | === added file 'utils/debian/menu.ex' |
1362 | --- utils/debian/menu.ex 1970-01-01 00:00:00 +0000 |
1363 | +++ utils/debian/menu.ex 2010-08-10 17:17:44 +0000 |
1364 | @@ -0,0 +1,2 @@ |
1365 | +?package(xtrabackup):needs="X11|text|vc|wm" section="Applications/see-menu-manual"\ |
1366 | + title="xtrabackup" command="/usr/bin/xtrabackup" |
1367 | |
1368 | === added file 'utils/debian/postinst.ex' |
1369 | --- utils/debian/postinst.ex 1970-01-01 00:00:00 +0000 |
1370 | +++ utils/debian/postinst.ex 2010-08-10 17:17:44 +0000 |
1371 | @@ -0,0 +1,41 @@ |
1372 | +#!/bin/sh |
1373 | +# postinst script for xtrabackup |
1374 | +# |
1375 | +# see: dh_installdeb(1) |
1376 | + |
1377 | +set -e |
1378 | + |
1379 | +# summary of how this script can be called: |
1380 | +# * <postinst> `configure' <most-recently-configured-version> |
1381 | +# * <old-postinst> `abort-upgrade' <new version> |
1382 | +# * <conflictor's-postinst> `abort-remove' `in-favour' <package> |
1383 | +# <new-version> |
1384 | +# * <postinst> `abort-remove' |
1385 | +# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' |
1386 | +# <failed-install-package> <version> `removing' |
1387 | +# <conflicting-package> <version> |
1388 | +# for details, see http://www.debian.org/doc/debian-policy/ or |
1389 | +# the debian-policy package |
1390 | + |
1391 | + |
1392 | +case "$1" in |
1393 | + configure) |
1394 | + ;; |
1395 | + |
1396 | + abort-upgrade|abort-remove|abort-deconfigure) |
1397 | + ;; |
1398 | + |
1399 | + *) |
1400 | + echo "postinst called with unknown argument \`$1'" >&2 |
1401 | + exit 1 |
1402 | + ;; |
1403 | +esac |
1404 | + |
1405 | +# dh_installdeb will replace this with shell code automatically |
1406 | +# generated by other debhelper scripts. |
1407 | + |
1408 | +#DEBHELPER# |
1409 | + |
1410 | +exit 0 |
1411 | + |
1412 | + |
1413 | |
1414 | === added file 'utils/debian/postrm.ex' |
1415 | --- utils/debian/postrm.ex 1970-01-01 00:00:00 +0000 |
1416 | +++ utils/debian/postrm.ex 2010-08-10 17:17:44 +0000 |
1417 | @@ -0,0 +1,39 @@ |
1418 | +#!/bin/sh |
1419 | +# postrm script for xtrabackup |
1420 | +# |
1421 | +# see: dh_installdeb(1) |
1422 | + |
1423 | +set -e |
1424 | + |
1425 | +# summary of how this script can be called: |
1426 | +# * <postrm> `remove' |
1427 | +# * <postrm> `purge' |
1428 | +# * <old-postrm> `upgrade' <new-version> |
1429 | +# * <new-postrm> `failed-upgrade' <old-version> |
1430 | +# * <new-postrm> `abort-install' |
1431 | +# * <new-postrm> `abort-install' <old-version> |
1432 | +# * <new-postrm> `abort-upgrade' <old-version> |
1433 | +# * <disappearer's-postrm> `disappear' <overwriter> |
1434 | +# <overwriter-version> |
1435 | +# for details, see http://www.debian.org/doc/debian-policy/ or |
1436 | +# the debian-policy package |
1437 | + |
1438 | + |
1439 | +case "$1" in |
1440 | + purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) |
1441 | + ;; |
1442 | + |
1443 | + *) |
1444 | + echo "postrm called with unknown argument \`$1'" >&2 |
1445 | + exit 1 |
1446 | + ;; |
1447 | +esac |
1448 | + |
1449 | +# dh_installdeb will replace this with shell code automatically |
1450 | +# generated by other debhelper scripts. |
1451 | + |
1452 | +#DEBHELPER# |
1453 | + |
1454 | +exit 0 |
1455 | + |
1456 | + |
1457 | |
1458 | === added file 'utils/debian/preinst.ex' |
1459 | --- utils/debian/preinst.ex 1970-01-01 00:00:00 +0000 |
1460 | +++ utils/debian/preinst.ex 2010-08-10 17:17:44 +0000 |
1461 | @@ -0,0 +1,37 @@ |
1462 | +#!/bin/sh |
1463 | +# preinst script for xtrabackup |
1464 | +# |
1465 | +# see: dh_installdeb(1) |
1466 | + |
1467 | +set -e |
1468 | + |
1469 | +# summary of how this script can be called: |
1470 | +# * <new-preinst> `install' |
1471 | +# * <new-preinst> `install' <old-version> |
1472 | +# * <new-preinst> `upgrade' <old-version> |
1473 | +# * <old-preinst> `abort-upgrade' <new-version> |
1474 | +# for details, see http://www.debian.org/doc/debian-policy/ or |
1475 | +# the debian-policy package |
1476 | + |
1477 | + |
1478 | +case "$1" in |
1479 | + install|upgrade) |
1480 | + ;; |
1481 | + |
1482 | + abort-upgrade) |
1483 | + ;; |
1484 | + |
1485 | + *) |
1486 | + echo "preinst called with unknown argument \`$1'" >&2 |
1487 | + exit 1 |
1488 | + ;; |
1489 | +esac |
1490 | + |
1491 | +# dh_installdeb will replace this with shell code automatically |
1492 | +# generated by other debhelper scripts. |
1493 | + |
1494 | +#DEBHELPER# |
1495 | + |
1496 | +exit 0 |
1497 | + |
1498 | + |
1499 | |
1500 | === added file 'utils/debian/prerm.ex' |
1501 | --- utils/debian/prerm.ex 1970-01-01 00:00:00 +0000 |
1502 | +++ utils/debian/prerm.ex 2010-08-10 17:17:44 +0000 |
1503 | @@ -0,0 +1,40 @@ |
1504 | +#!/bin/sh |
1505 | +# prerm script for xtrabackup |
1506 | +# |
1507 | +# see: dh_installdeb(1) |
1508 | + |
1509 | +set -e |
1510 | + |
1511 | +# summary of how this script can be called: |
1512 | +# * <prerm> `remove' |
1513 | +# * <old-prerm> `upgrade' <new-version> |
1514 | +# * <new-prerm> `failed-upgrade' <old-version> |
1515 | +# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version> |
1516 | +# * <deconfigured's-prerm> `deconfigure' `in-favour' |
1517 | +# <package-being-installed> <version> `removing' |
1518 | +# <conflicting-package> <version> |
1519 | +# for details, see http://www.debian.org/doc/debian-policy/ or |
1520 | +# the debian-policy package |
1521 | + |
1522 | + |
1523 | +case "$1" in |
1524 | + remove|upgrade|deconfigure) |
1525 | + ;; |
1526 | + |
1527 | + failed-upgrade) |
1528 | + ;; |
1529 | + |
1530 | + *) |
1531 | + echo "prerm called with unknown argument \`$1'" >&2 |
1532 | + exit 1 |
1533 | + ;; |
1534 | +esac |
1535 | + |
1536 | +# dh_installdeb will replace this with shell code automatically |
1537 | +# generated by other debhelper scripts. |
1538 | + |
1539 | +#DEBHELPER# |
1540 | + |
1541 | +exit 0 |
1542 | + |
1543 | + |
1544 | |
1545 | === added file 'utils/debian/rules' |
1546 | --- utils/debian/rules 1970-01-01 00:00:00 +0000 |
1547 | +++ utils/debian/rules 2010-08-10 17:17:44 +0000 |
1548 | @@ -0,0 +1,109 @@ |
1549 | +#!/usr/bin/make -f |
1550 | +# -*- makefile -*- |
1551 | +# Sample debian/rules that uses debhelper. |
1552 | +# This file was originally written by Joey Hess and Craig Small. |
1553 | +# As a special exception, when this file is copied by dh-make into a |
1554 | +# dh-make output file, you may use that output file without restriction. |
1555 | +# This special exception was added by Craig Small in version 0.37 of dh-make. |
1556 | + |
1557 | +# Uncomment this to turn on verbose mode. |
1558 | +#export DH_VERBOSE=1 |
1559 | + |
1560 | + |
1561 | +# These are used for cross-compiling and for saving the configure script |
1562 | +# from having to guess our platform (since we know it already) |
1563 | +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
1564 | +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) |
1565 | +ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) |
1566 | +CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) |
1567 | +else |
1568 | +CROSS= --build $(DEB_BUILD_GNU_TYPE) |
1569 | +endif |
1570 | + |
1571 | +MAKE_J = -j$(shell if [ -f /proc/cpuinfo ] ; then grep -c processor.* /proc/cpuinfo ; else echo 1 ; fi) |
1572 | + |
1573 | + |
1574 | +config.status: configure |
1575 | + dh_testdir |
1576 | + # Add here commands to configure the package. |
1577 | +ifneq "$(wildcard /usr/share/misc/config.sub)" "" |
1578 | + cp -f /usr/share/misc/config.sub config.sub |
1579 | +endif |
1580 | +ifneq "$(wildcard /usr/share/misc/config.guess)" "" |
1581 | + cp -f /usr/share/misc/config.guess config.guess |
1582 | +endif |
1583 | + ./configure --enable-local-infile --enable-thread-safe-client --with-plugins=innobase --with-zlib-dir=bundled --with-extra-charsets=complex |
1584 | + |
1585 | + |
1586 | +build: build-stamp |
1587 | + |
1588 | +build-stamp: config.status |
1589 | + dh_testdir |
1590 | + |
1591 | + # Add here commands to compile the package. |
1592 | + $(MAKE) $(MAKE_J) |
1593 | + cd storage/innobase/xtrabackup && $(MAKE) && cd - |
1594 | + cd libtar-1.2.11 && ./configure --prefix=/usr && $(MAKE) && cd - |
1595 | + |
1596 | + #docbook-to-man debian/xtrabackup.sgml > xtrabackup.1 |
1597 | + |
1598 | + touch $@ |
1599 | + |
1600 | +clean: |
1601 | + dh_testdir |
1602 | + dh_testroot |
1603 | + rm -f build-stamp |
1604 | + |
1605 | + # Add here commands to clean up after the build process. |
1606 | + [ ! -f Makefile ] || $(MAKE) distclean |
1607 | + rm -f config.sub config.guess |
1608 | + |
1609 | + dh_clean |
1610 | + |
1611 | +install: build |
1612 | + dh_testdir |
1613 | + dh_testroot |
1614 | + dh_clean -k |
1615 | + dh_installdirs |
1616 | + |
1617 | + # Add here commands to install the package into debian/xtrabackup. |
1618 | + cd storage/innobase/xtrabackup && install xtrabackup $(CURDIR)/debian/xtrabackup/usr/bin && install innobackupex-1.5.1 $(CURDIR)/debian/xtrabackup/usr/bin && cd - |
1619 | + cd libtar-1.2.11/libtar/ && install tar4ibd $(CURDIR)/debian/xtrabackup/usr/bin && cd - |
1620 | + |
1621 | +# Build architecture-independent files here. |
1622 | +binary-indep: build install |
1623 | +# We have nothing to do by default. |
1624 | + |
1625 | +# Build architecture-dependent files here. |
1626 | +binary-arch: build install |
1627 | + dh_testdir |
1628 | + dh_testroot |
1629 | + dh_installchangelogs ChangeLog |
1630 | + dh_installdocs |
1631 | + dh_installexamples |
1632 | +# dh_install |
1633 | +# dh_installmenu |
1634 | +# dh_installdebconf |
1635 | +# dh_installlogrotate |
1636 | +# dh_installemacsen |
1637 | +# dh_installpam |
1638 | +# dh_installmime |
1639 | +# dh_python |
1640 | +# dh_installinit |
1641 | +# dh_installcron |
1642 | +# dh_installinfo |
1643 | + dh_installman |
1644 | + dh_link |
1645 | + dh_strip |
1646 | + dh_compress |
1647 | + dh_fixperms |
1648 | +# dh_perl |
1649 | +# dh_makeshlibs |
1650 | + dh_installdeb |
1651 | + dh_shlibdeps |
1652 | + dh_gencontrol |
1653 | + dh_md5sums |
1654 | + dh_builddeb |
1655 | + |
1656 | +binary: binary-indep binary-arch |
1657 | +.PHONY: build clean binary-indep binary-arch binary install |
1658 | |
1659 | === added file 'utils/debian/watch.ex' |
1660 | --- utils/debian/watch.ex 1970-01-01 00:00:00 +0000 |
1661 | +++ utils/debian/watch.ex 2010-08-10 17:17:44 +0000 |
1662 | @@ -0,0 +1,23 @@ |
1663 | +# Example watch control file for uscan |
1664 | +# Rename this file to "watch" and then you can run the "uscan" command |
1665 | +# to check for upstream updates and more. |
1666 | +# See uscan(1) for format |
1667 | + |
1668 | +# Compulsory line, this is a version 3 file |
1669 | +version=3 |
1670 | + |
1671 | +# Uncomment to examine a Webpage |
1672 | +# <Webpage URL> <string match> |
1673 | +#http://www.example.com/downloads.php xtrabackup-(.*)\.tar\.gz |
1674 | + |
1675 | +# Uncomment to examine a Webserver directory |
1676 | +#http://www.example.com/pub/xtrabackup-(.*)\.tar\.gz |
1677 | + |
1678 | +# Uncommment to examine a FTP server |
1679 | +#ftp://ftp.example.com/pub/xtrabackup-(.*)\.tar\.gz debian uupdate |
1680 | + |
1681 | +# Uncomment to find new files on sourceforge, for devscripts >= 2.9 |
1682 | +# http://sf.net/xtrabackup/xtrabackup-(.*)\.tar\.gz |
1683 | + |
1684 | +# Uncomment to find new files on GooglePages |
1685 | +# http://example.googlepages.com/foo.html xtrabackup-(.*)\.tar\.gz |
1686 | |
1687 | === added file 'utils/debian/xtrabackup.default.ex' |
1688 | --- utils/debian/xtrabackup.default.ex 1970-01-01 00:00:00 +0000 |
1689 | +++ utils/debian/xtrabackup.default.ex 2010-08-10 17:17:44 +0000 |
1690 | @@ -0,0 +1,10 @@ |
1691 | +# Defaults for xtrabackup initscript |
1692 | +# sourced by /etc/init.d/xtrabackup |
1693 | +# installed at /etc/default/xtrabackup by the maintainer scripts |
1694 | + |
1695 | +# |
1696 | +# This is a POSIX shell fragment |
1697 | +# |
1698 | + |
1699 | +# Additional options that are passed to the Daemon. |
1700 | +DAEMON_OPTS="" |
1701 | |
1702 | === added file 'utils/debian/xtrabackup.doc-base.EX' |
1703 | --- utils/debian/xtrabackup.doc-base.EX 1970-01-01 00:00:00 +0000 |
1704 | +++ utils/debian/xtrabackup.doc-base.EX 2010-08-10 17:17:44 +0000 |
1705 | @@ -0,0 +1,22 @@ |
1706 | +Document: xtrabackup |
1707 | +Title: Debian xtrabackup Manual |
1708 | +Author: <insert document author here> |
1709 | +Abstract: This manual describes what xtrabackup is |
1710 | + and how it can be used to |
1711 | + manage online manuals on Debian systems. |
1712 | +Section: unknown |
1713 | + |
1714 | +Format: debiandoc-sgml |
1715 | +Files: /usr/share/doc/xtrabackup/xtrabackup.sgml.gz |
1716 | + |
1717 | +Format: postscript |
1718 | +Files: /usr/share/doc/xtrabackup/xtrabackup.ps.gz |
1719 | + |
1720 | +Format: text |
1721 | +Files: /usr/share/doc/xtrabackup/xtrabackup.text.gz |
1722 | + |
1723 | +Format: HTML |
1724 | +Index: /usr/share/doc/xtrabackup/html/index.html |
1725 | +Files: /usr/share/doc/xtrabackup/html/*.html |
1726 | + |
1727 | + |
1728 | |
1729 | === modified file 'utils/xtrabackup.spec' |
1730 | --- utils/xtrabackup.spec 2010-08-10 10:48:03 +0000 |
1731 | +++ utils/xtrabackup.spec 2010-08-10 17:17:44 +0000 |
1732 | @@ -5,9 +5,16 @@ |
1733 | %{!?buildnumber:%define buildnumber 1} |
1734 | %define distribution rhel%{redhat_version} |
1735 | %define release %{buildnumber}.%{distribution} |
1736 | +<<<<<<< TREE |
1737 | %define xtrabackup_version 1.3 |
1738 | %define xtradb_version 11 |
1739 | +======= |
1740 | +%define xtrabackup_version 1.2 |
1741 | +>>>>>>> MERGE-SOURCE |
1742 | %{!?xtrabackup_revision:%define xtrabackup_revision undefined} |
1743 | +%define mysql_version 5.1.45 |
1744 | +%define innodb_plugin_version 1.0.6 |
1745 | +%define xtradb_version 10 |
1746 | |
1747 | %define __os_install_post /usr/lib/rpm/brp-compress |
1748 | |
1749 | @@ -18,8 +25,16 @@ |
1750 | Group: Server/Databases |
1751 | License: GPLv2 |
1752 | Packager: Vadim Tkachenko <vadim@percona.com> |
1753 | +<<<<<<< TREE |
1754 | URL: http://www.percona.com/software/percona-xtrabackup/ |
1755 | Source: xtrabackup-%{xtrabackup_version}.tar.gz |
1756 | +======= |
1757 | +URL: http://percona.com/percona-lab.html |
1758 | +Source0: mysql-%{mysql_version}.tar.gz |
1759 | +Source1: http://www.percona.com/percona-builds/Percona-XtraDB/Percona-XtraDB-%{mysql_version}-%{xtradb_version}/source/percona-xtradb-%{innodb_plugin_version}-%{xtradb_version}.tar.gz |
1760 | +Source2: ftp://ftp.feep.net/pub/software/libtar/libtar-1.2.11.tar.gz |
1761 | +Source3: xtrabackup-%{xtrabackup_version}.tar.gz |
1762 | +>>>>>>> MERGE-SOURCE |
1763 | BuildRoot: %{_tmppath}/%{name}-%{version}-root |
1764 | Requires: mysql |
1765 | |
1766 | @@ -39,17 +54,46 @@ |
1767 | |
1768 | |
1769 | %prep |
1770 | +<<<<<<< TREE |
1771 | %setup -q |
1772 | +======= |
1773 | |
1774 | +%setup -n mysql-%{mysql_version} -q |
1775 | +tar zxf $RPM_SOURCE_DIR/libtar-1.2.11.tar.gz |
1776 | +cd libtar-1.2.11 |
1777 | +cd ../ |
1778 | +cd storage |
1779 | +rm -rf innobase |
1780 | +tar zxf $RPM_SOURCE_DIR/percona-xtradb-%{innodb_plugin_version}-%{xtradb_version}.tar.gz |
1781 | +mv percona-xtradb-%{innodb_plugin_version}-%{xtradb_version} innobase |
1782 | +cd innobase |
1783 | +tar zxf $RPM_SOURCE_DIR/xtrabackup-%{xtrabackup_version}.tar.gz |
1784 | +mv xtrabackup-%{xtrabackup_version} xtrabackup |
1785 | +patch -p1 < xtrabackup/fix_innodb_for_backup_xtradb.patch |
1786 | +cd ../../libtar-1.2.11 |
1787 | +patch -p1 < ../storage/innobase/xtrabackup/tar4ibd_libtar-1.2.11.patch |
1788 | +>>>>>>> MERGE-SOURCE |
1789 | |
1790 | %build |
1791 | export CC=${CC-"gcc"} |
1792 | export CXX=$CC |
1793 | export CFLAGS="$CFLAGS -DXTRABACKUP_VERSION=\\\"%{xtrabackup_version}\\\" -DXTRABACKUP_REVISION=\\\"%{xtrabackup_revision}\\\"" |
1794 | +<<<<<<< TREE |
1795 | export CXXFLAGS="$CXXFLAGS -DXTRABACKUP_VERSION=\\\"%{xtrabackup_version}\\\" -DXTRABACKUP_REVISION=\\\"%{xtrabackup_revision}\\\"" |
1796 | cp $RPM_SOURCE_DIR/libtar-1.2.11.tar.gz $RPM_SOURCE_DIR/mysql-5.0.91.tar.gz . |
1797 | ./utils/build.sh 5.0 |
1798 | ./utils/build.sh xtradb |
1799 | +======= |
1800 | +./configure \ |
1801 | + --prefix=%{_prefix} --enable-local-infile --enable-thread-safe-client --with-plugins=innobase --with-zlib-dir=bundled --with-extra-charsets=complex |
1802 | +make -j`if [ -f /proc/cpuinfo ] ; then grep -c processor.* /proc/cpuinfo ; else echo 1 ; fi` |
1803 | +cd storage/innobase/xtrabackup |
1804 | +make |
1805 | +cd ../../.. |
1806 | +cd libtar-1.2.11 |
1807 | +./configure --prefix=%{_prefix} |
1808 | +make |
1809 | +>>>>>>> MERGE-SOURCE |
1810 | |
1811 | %install |
1812 | [ "%{buildroot}" != '/' ] && rm -rf %{buildroot} |