Package: udev
Version: 153-2
Severity: normal
Tags: patch

When /etc/network/interfaces has an allow-hotplug interface like

  allow-hotplug eth0
  iface eth0 inet dhcp

then udev calls ifup, via the /lib/udev/net.agent script on that
interface when it is discovered.  But udev helper scripts all run at
nice priority -2 (see the UDEV_PRIORITY #define in udev/udevd.c, and the
call to setpriority() in worker_new()).  This would be fine, except that
ifup can start long-running daemons like dhclient3, and it runs all the
scripts in /etc/network/if-up.d, and at least one of those
(openssh-server) runs a daemon's init script with the "restart" target.
This results in some daemons like sshd and dhclient3 running with nice
priority -2.

I don't believe this is an intended effect - I certainly didn't expect
sshd (and hence all processes started or services restarted by a user
ssh-ing in) to run at an elevated scheduling priority.  The following
patch to net.agent causes it to set its nice priority to 0 before trying
to do anything else.


--- net.agent.orig      2010-05-11 14:50:38.000000000 -0600
+++ net.agent   2010-05-11 14:57:18.000000000 -0600
@@ -3,6 +3,10 @@
 # run /sbin/{ifup,ifdown} with the --allow=hotplug option.
 #
 
+# Since running ifup can result in restarting daemons, we should reset our nice
+# priority
+renice -n 0 $$
+
 . /lib/udev/hotplug.functions
 
 if [ -z "$INTERFACE" ]; then


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-3-amd64 (SMP w/16 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages udev depends on:
ii  debconf [debconf-2.0]        1.5.32      Debian configuration management sy
ii  libc6                        2.10.2-6    Embedded GNU C Library: Shared lib
ii  libselinux1                  2.0.94-1    SELinux runtime shared libraries
ii  libusb-0.1-4                 2:0.1.12-14 userspace USB programming library
ii  lsb-base                     3.2-23.1    Linux Standard Base 3.2 init scrip
ii  util-linux                   2.16.2-0    Miscellaneous system utilities

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

udev suggests no packages.

-- debconf information:
  udev/new_kernel_needed: false
  udev/title/upgrade:
  udev/reboot_needed:

-- 
+-----------------------------------------+
| John Wright <john.wri...@hp.com>        |
| Hewlett-Packard Telco Platform Software |
+-----------------------------------------+



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to