Bug#605015: /etc/init.d/udev: init script leaks file descriptors

2010-12-07 Thread Arthur de Jong
On Tue, 2010-12-07 at 16:09 +0100, Marco d'Itri wrote:
 No, the problem is that the daemon is started in an unclean environment.
 The upstream maintainer does not believe this to be a bug and I agree.

Too bad, thanks for considering anyway.

 _SC_OPEN_MAX can be huge, this is a waste of time.

Apparently close() should be really fast on not-open file descriptors so
this shouldn't be a problem (and this is only done on start-up so only
happens once).

-- 
-- arthur - adej...@debian.org - http://people.debian.org/~adejong --


signature.asc
Description: This is a digitally signed message part


Bug#605015: /etc/init.d/udev: init script leaks file descriptors

2010-11-26 Thread Arthur de Jong
Subject: /etc/init.d/udev: init script leaks file descriptors
Package: udev
Version: 164-2
File: /etc/init.d/udev
Severity: normal

The /etc/init.d/udev script leaks passed file descriptors to
the /sbin/udevd daemon. This causes problems problems for
unattended-upgrades (see #379645). Daemons should generally close all
open file descriptors when starting up.

In this case it is probably easiest to close file descriptors in the
daemon itself. I use this code myself:

/* close all other file descriptors */
m=sysconf(_SC_OPEN_MAX);
/* if the system does not have OPEN_MAX just close the first 32 and
   hope we closed enough */
if (m0)
  m=32;
for (i=3;im;i++)
  close(i);

Thanks.

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (900, 'testing'), (800, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.35-rc5-686 (SMP w/2 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages udev depends on:
ii  debconf [debconf-2.0]1.5.36  Debian configuration management sy
ii  libc62.11.2-7Embedded GNU C Library: Shared lib
ii  libselinux1  2.0.96-1SELinux runtime shared libraries
ii  libudev0 164-2   libudev shared library
ii  libusb-0.1-4 2:0.1.12-16 userspace USB programming library
ii  lsb-base 3.2-23.1Linux Standard Base 3.2 init scrip
ii  util-linux   2.17.2-3.3  Miscellaneous system utilities

Versions of packages udev recommends:
ii  pciutils  1:3.1.7-5  Linux PCI Utilities
ii  usbutils  0.87-5 Linux USB utilities

-- 
-- arthur - adej...@debian.org - http://people.debian.org/~adejong --


signature.asc
Description: This is a digitally signed message part