Bug#581339: Me too (FD warning spam in crontab)

Greg Wooledge wooledg at eeg.ccf.org
Thu Dec 2 13:52:44 UTC 2010


I'm getting these as well.  It's rather annoying to get these spurious
warnings every day from an otherwise-working backup script.  I am NOT
going to try the udisks thing from that Red Hat error report, because
it's a report for a totally different symptom (lvremove is failing in
that report, not spamming a warning).

Linux ebase-adm 2.6.32-5-amd64 #1 SMP Thu Nov 25 18:02:11 UTC 2010 x86_64 GNU/Linux

ii  lvm2           2.02.66-4      The Linux Logical Volume Manager

Here's the crontab line:

15 18 * * * /usr/local/sbin/backup ebase-adm/ebase

And here's the script:
=============================================================================
#!/bin/bash

# Usage: backup LVname

# Backup script for Ebase VMs.
#  1) This should ideally be run *after* the database backup has completed.
#  2) Make a snapshot of the LV the virtual machine uses for storage.
#  3) Mount the first partition of that LV on /snap.
#  4) Tar it up, or something.
#  5) Unmount, and remove the snapshot LV.

export PATH=/usr/sbin:/sbin:/usr/bin:/bin

usage() {
    echo "usage: backup LVname"
    exit 1
}

[[ "$1" ]] || usage
[[ ! -e "$1" && ! -e "/dev/$1" ]] && usage
mkdir -p /snap || exit 1

trap 'cd /; umount /snap; lvremove -f ebase-adm/snap; exit 1' 1 2 3 15
lvcreate -L 8G -n snap -s "$1" || exit 1

# The file system partition begins at byte offset 32256 within the LV.
mount -o loop,ro,offset=32256 /dev/ebase-adm/snap /snap

cd /snap && rsync -a . /backup/"${1//\//_}"/

cd /
umount /snap
lvremove -f ebase-adm/snap
=============================================================================

And here's the email from cron:

----- Forwarded message from Cron Daemon <root at eeg.ccf.org> -----

Delivered-To: wooledg at imadev.eeg.ccf.org
Delivered-To: wooledg at eeg.ccf.org
X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on gateway.eeg.ccf.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00
	autolearn=ham version=3.3.0
Delivered-To: root at eeg.ccf.org
Date: Wed, 01 Dec 2010 18:15:11 -0500
From: root at eeg.ccf.org (Cron Daemon)
To: root at eeg.ccf.org
Subject: Cron <root at ebase-adm> /usr/local/sbin/backup ebase-adm/ebase
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>

File descriptor 5 (/tmp/tmpf7ksQyy (deleted)) leaked on lvcreate invocation. Parent PID 4718: /bin/bash
  Logical volume "snap" created
File descriptor 5 (/tmp/tmpf7ksQyy (deleted)) leaked on lvremove invocation. Parent PID 4718: /bin/bash
  Logical volume "snap" successfully removed

----- End forwarded message -----





More information about the pkg-lvm-maintainers mailing list