http://bugzilla.novell.com/show_bug.cgi?id=547932
Summary: Unexpected behaviour of zypper when reporting in use
deleted files at the end.
Classification: openSUSE
Product: openSUSE 11.2
Version: Factory
Platform: Other
OS/Version: openSUSE 11.2
Status: NEW
Severity: Normal
Priority: P5 - None
Component: libzypp
AssignedTo: zypp-maintainers@forge.provo.novell.com
ReportedBy: carlos.e.r@opensuse.org
QAContact: qa@suse.de
Found By: ---
I just discovered a useful feature of "zypper dup": that at the end reports
files that are supposedly deleted but are in use by some processes. This is a
feature that I have asked for for a long time.
But it has a glitch.
In my setup (see later), it produces a very long text, so long that the
beginning went off the top of the xterm window. So next time, I used "xterm -sl
3000": not enough. Finally, I saw the beginning with a 15000 lines buffer (an
iteration that delayed for some weeks, while I updated to milestone 6, 7,
8...):
+++***********
The following running processes use deleted files:
PID | PPID | UID | Login | Command | Service | Files
------+-------+------+---------+--------------------------+---------+----------------------------------------------------------------------------------------------
618 | 3550 | 0 | root | spamd | |
/usr/lib/libdb-4.5.so (path dev=3,9, inode=104822)
| | | | | |
/usr/lib/libdb-4.5.so (path dev=3,9, inode=104822)
| | | | | |
/lib/libnss_nis-2.8.so (stat: No such file or directory)
| | | | | |
/lib/libnss_compat-2.8.so (stat: No such file or directory)
| | | | | |
/lib/libnss_files-2.8.so (stat: No such file or directory)
..
(thousands of lines more)
..
***********++-
Why so long an output? Because I'm running zypper dup of the factory partition
in a chroot, inside a 11.0 system. Your code is seeing the "host" files, not
only the guest (the guest has no running processes, except bash).
(I always do the update this way, because it is safer, and I can work while it
runs for hours and (long) hours)
I use a different code than you to detect those in use deleted files, which
doesn't fail in the exact same way, but fails, too. It is a variation of a
script published by Bob Vickers on the security list on Tue, 10 Jan 2006
10:14:59 +0000 (GMT). I haven't had the occasion to test it on current factory:
#!/bin/bash
set -o nounset
procs=`lsof -n | grep -E 'RPMDELETE|;|path inode=' `
if [ -n "$procs" ]
then
host=`hostname`
cat <