[Debconf-devel] Bug#563577: Debconf fails to gain exclusive flock on readonly file descriptor on Solaris

James Lee jbit at jbit.net
Sun Jan 3 21:03:08 UTC 2010


Package: debconf
Version: 1.5.28

This happens on Nexenta with unpatched debconf and when running Debian
GNU/Linux in a branded zone.

When running various apt tasks (install in particular) on
(Open)Solaris the following message is seen, which in a lot of cases
will result in the apt task failing.
  debconf: DbDriver "config": /var/cache/debconf/config.dat is locked
by another process: Bad file descriptor

This is because "Debconf/DbDriver/File.pm" is trying to acquire an
exclusive file lock on a read only file descriptor which the Solaris
kernel does not allow (and AFAIK isn't allowed by POSIX either). Even
though this doesn't cause issues on Linux systems it would be really
nice to have this fixed upstream to avoid patching debconf on every
install.

On my local machines I am modifying File.pm to open the file
descriptor as read/write which fixes the problem (and works on a real
Linux kernel too), however I'm not sure if this will affect any other
operations of debconf, but as far as I can tell it will not.

On line 51 of File.pm change:
    if (! open ($this->{_fh}, $this->{filename})) {
to:
    if (! open ($this->{_fh}, "+<", $this->{filename})) {

Further information:
http://blog.jbit.net/2009/12/debconf-issues-on-opensolaris.html - My
blog post about the issue and research
http://trisk.acm.jhu.edu/etch-zone.html - A tutorial on installing
Debian GNU/Linux in a Solaris zone
http://www.nexenta.org/diffs-gnusolaris/nexenta-delta-debconf.454083.diff
- Nexentas diff (changes the lock type)





More information about the Debconf-devel mailing list