Bug#924595: backup2l: Sometimes fails to detect running instance.

2019-03-19 Thread Wayne Conrad
On Fri, 15 Mar 2019 10:31:36 +0100 Gundolf Kiefer
 wrote:
> Thank you for the great report and the patch!
> 
> I applied the patch upstream:
> 
> https://github.com/gkiefer/backup2l/commit/3941b1a50aa184a4e42fcf80345b248472404108
> 
> -- Gundolf Kiefer
> 
> 

Gundolf,

Thank you for the quick response and for doing the work of maintaining
the package.  It is greatly appreciated!

Wayne Conrad



Bug#924595: backup2l: Sometimes fails to detect running instance.

2019-03-15 Thread Gundolf Kiefer
Thank you for the great report and the patch!

I applied the patch upstream:

https://github.com/gkiefer/backup2l/commit/3941b1a50aa184a4e42fcf80345b248472404108

-- Gundolf Kiefer



Bug#924595: backup2l: Sometimes fails to detect running instance.

2019-03-14 Thread wayne
Package: backup2l
Version: 1.6-3
Severity: normal
Tags: upstream patch

Dear Maintainer,

backup2l can sometimes fail to detect a running instance, such that
two instances are running at the same time.  This occurs when backup2l
is run manually, and then disowned such that backup2l no longer
belongs to the shell I used to start it.  If I then run backup2l again
while the disowned backup2l is still running, the second run will
start running rather that complaining about the lock file and
existing.  Or, if the daily cron job runs, it will start another
instance of backup2l.

To reproduce, do this as root, in bash:

backup2l -b
disown %1

Then while the disowned instance is still running:

backup2l -s

This will run, instead of complaining about the lockfile as expected.
It then removes the lock file.

I believe this occurs because backup2l is using `ps -a` to find the
running backup2l instances, but a disowned backup2l does not show up
in `ps -a`.  Instead, `ps -ax` needs to be used.  The attached patch,
which has this change, seems to fix the problem for me.

Background: I disowned the manual backup2l because I needed the
long-running manual backup to continue even if the SSH session were
interrupted.

-- System Information:
Debian Release: 8.10
  APT prefers oldstable
  APT policy: (990, 'oldstable'), (500, 'oldstable-updates'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

backup2l depends on no packages.

Versions of packages backup2l recommends:
ii  bzip2  1.0.6-7+b3

Versions of packages backup2l suggests:
ii  xz-utils  5.1.1alpha+20120614-2+b3

-- Configuration Files:
/etc/backup2l.conf changed:
FOR_VERSION=1.5
VOLNAME="all"
SRCLIST=(/mnt/sdc/mls/nwmls /mnt/sdf/terabitz)
SKIPCOND=(-xdev -path ./documents.new -prune)
BACKUP_DIR="/mnt/hcf/diamond_backups"
MAX_LEVEL=8
MAX_PER_LEVEL=8
MAX_FULL=2
GENERATIONS=1
CREATE_CHECK_FILE=1
PRE_BACKUP ()
{
echo "  pre-backup: nothing to do"
# e. g., shut down some mail/db servers if their files are to be backup'ed
# On a Debian system, the following statements dump a machine-readable list 
of
# all installed packages to a file.
#echo "  writing dpkg selections to /root/dpkg-selections.log..."
#dpkg --get-selections | diff - /root/dpkg-selections.log > /dev/null || 
dpkg --get-selections > /root/dpkg-selections.log
}
POST_BACKUP ()
{
# e. g., restart some mail/db server if its files are to be backup'ed
echo "  post-backup: nothing to do"
}
AUTORUN=0
SIZE_UNITS=""# set to "B", "K", "M" or "G" to obtain unified units in 
summary list
DRIVER_MY_AFIOZ ()
{
case $1 in
-test)
# This function should check whether all prerequisites are met, 
especially if all
# required tools are installed. This prevents backup2l to fail in 
inconvenient
# situations, e. g. during a backup or restore operation. If 
everything is ok, the
# string "ok" should be returned. Everything else is interpreted as 
a failure.
require_tools afio
# The function 'require_tools' checks for the existence of all 
tools passed as
# arguments. If one of the tools is not found by which(1), an 
error message is
# displayed and the function does not return.
echo "ok"
;;
-suffix)
# This function should return the suffix of backup archive files. 
If the driver
#�does not create a file (e. g. transfers the backup data 
immediately to a tape
# or network device), an empty string has to be returned. backup2l 
uses this suffix
# to select a driver for unpacking. If a user-configured driver 
supports the same
# suffix as a built-in driver, the user driver is preferred (as in 
this case).
echo "afioz"
;;
-create)# Arguments: $2 = BID, $3 = archive file name, $4 = 
file list file
# This function is called to create a backup file. The argument $3 
is the full file
# name of the archive file including path and suffix. $4 contains 
an alphabetically
# sorted  list of files (full pathname) to be backed up. 
Directories are not contained,
# they are handled by backup2l directly without using the driver.
# All output to stderr should be directed to stdout ("2>&1").
afio -Zo -G 9 -M 30m -T 2k $3 < $4 2>&1
# This line passes some additional options to afio (see 
afio(1)):
# '-G 9' maximizes the compression by gzip.
# '-M 30m' increases the size of the internal file buffer. 
Larger files have to
# be compressed twice.
# '-T 2k' prevents the compression of files smaller than 2k in 
order to save