On Wed, Jan 16, 2008 at 04:55:54PM +0100, Lionel Elie Mamane wrote:
> On Wed, Jan 16, 2008 at 04:30:52PM +0100, Marco d'Itri wrote:
>> On Jan 16, Lionel Elie Mamane <[EMAIL PROTECTED]> wrote:

>>> Hmm... I have now found the source of the problem (in bug
>>> #408506). On machines where it works well,
>>> /etc/udev/rules.dev/udev.rules is symlinked to ../udev.rules, on
>>> machines where it doesn't, it is not the case. Adding the symlink
>>> solves the problem. So the bug is that the udev package did not add
>>> that symlink automatically in some install/upgrade scenario or
>>> removed it during an upgrade or ...

>> I just do not believe this.

> Well, the situation is that on the machine where I was having the
> problem, there was no /etc/udev/rules.dev/udev.rules . Whether udev
> didn't put it (e.g. because the postinst script is not idempotent if
> interrupted at an arbitrary point),

Looking at the postinst of udev 0.114-2, it seems that it is indeed
not failure-safe. Debian Policy 6.2 says (about maintainer scripts):

 If the first call failed, or aborted half way through for some
 reason, the second call should merely do the things that were left
 undone the first time, if any, and exit with a success status if
 everything is OK.

but the create_rules_symlink function of the postinst, in the
following scenario:

 - it does part of its job and gets interrupted by an error condition
   (disk full, control-c, power failure of the computer, crash of the
   computer, ...)

 - it gets rerun by dpkg

In this scenario, it does not finish its work in the rerun, because
of:

  # stop if one of the links already exists
  for file in devfs.rules compat.rules compat-full.rules \
      udev.rules 020_permissions.rules z55_hotplug.rules \
      z20_persistent-input.rules z45_persistent-net-generator.rules \
      z20_persistent.rules z50_run.rules \
      z75_cd-aliases-generator.rules; do
    [ ! -e $file -a ! -L $file ] || return 0
  done

So, e.g. if gets stopped between

  if [ "$(dpkg --print-architecture)" != s390 ]; then
    ln -s ../persistent-net-generator.rules z45_persistent-net-generator.rules
  fi

and

  if [ -c /dev/.devfsd -o -c /dev/vc/1 ]; then

then the udev.rules symlink is never created. It is not a policy
violation that makes it a serious bug ("should" directive and not
"must"), but still, I think it is a lack of robustness.

-- 
Lionel



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to