[pkg-fso-maint] Bug#520925: wicd: uses killall without depending on psmisc

Luca Capello luca at pca.it
Mon Mar 23 16:45:36 UTC 2009


Package: wicd
Version: 1.5.9-5
Severity: important
User: pkg-fso-maint at lists.alioth.debian.org
Usertags: package-installation

Hello,

the subject says all, here the relevant part of the code:
=====
luca at gismo:~$ grep -r killall wicd-1.5.9/*
wicd-1.5.9/wicd/wicd-daemon.py:        misc.Run("killall dhclient dhclient3 wpa_supplicant")
wicd-1.5.9/wicd/wnettools.py:    cmd = 'killall dhclient dhclient3 pump dhcpcd-bin'
wicd-1.5.9/wicd/wnettools.py:        cmd = 'killall wpa_supplicant'
luca at gismo:~$
=====

However, I consider none of the cases above a correct use of killall.
From `man killall`:

  DESCRIPTION
       killall sends a signal to all processes running any of the
       specified commands.

I think it is clear that killall should be regard as a last option: if I
have two processes foo and I want to kill only one of them, killall will
fail here.  Actually, killall works the same as

  $ kill `pidof $PROGRAM`

Indeed, `man pidof`:

  NOTES
       pidof is actually the same program as killall5; the program
       behaves according to the name under which it is called.

       When pidof is invoked with a full pathname to the program it
       should find the pid of, it is reasonably safe. Otherwise it is
       possible that it returns pids of running programs that happen to
       have the same name as the program you're after but are actually
       other programs.

The major advantage of the kill+pidof equivalent is that it both
programs are installed by default on every Debian system (the first
provided by procps, the second by sysvinit-utils, both packages priority
required).  The Debian FSO team experienced the very same problem two
times in the past:

  http://lists.linuxtogo.org/pipermail/smartphones-userland/2008-December/000751.html

However, as I wrote before, I would strongly discourage using killall.
Instead, since AFAIK all DHCP clients wicd can use (including udhcpc
once bug #520014 will be fixed) support a "write the PID to a file"
option, the best solution would be to check for the existence of such a
PID file (usually /var/run/$PROGRAM.$IFACE.pid) and then kill this
specific process.

I would like to find some consensus on this solution before starting to
implement it ;-)

Thx, bye,
Gismo / Luca

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: armel (armv4tl)

Kernel: Linux 2.6.29-20090303.gitb9de904e (PREEMPT)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages wicd depends on:
ii  adduser                       3.110      add and remove users and groups
pn  dhcpcd | dhcp3-client | pump  <none>     (no description available)
ii  net-tools                     1.60-23    The NET-3 networking toolkit
ii  python                        2.5.4-2    An interactive high-level object-o
ii  python-dbus                   0.83.0-1   simple interprocess messaging syst
ii  python-glade2                 2.14.1-1   GTK+ bindings: Glade support
ii  python-gtk2                   2.14.1-1   Python bindings for the GTK+ widge
ii  python-support                0.8.7      automated rebuilding support for P
ii  wireless-tools                29-1.1     Tools for manipulating Linux Wirel
ii  wpasupplicant                 0.6.4-3    Client support for WPA and WPA2 (I

wicd recommends no packages.

Versions of packages wicd suggests:
pn  pm-utils                      <none>     (no description available)

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 314 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-fso-maint/attachments/20090323/f104392c/attachment.pgp 


More information about the pkg-fso-maint mailing list