[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#390038: this is caused by the use of /sbin/update-grub



the linux-image .postrm script is (through some mechanism) invoking 
/sbin/update-grub.

/sbin/update-grub gives a warning now:

You shouldn't call /sbin/update-grub. Please call /usr/sbin/update-grub instead!

except that warning is sent on stdout.

stdout in the .postrm script is hooked up through some pipe for
some sort of parent/child communication and the result is that
this /sbin/update-grub warning ends up being sent to the parent,
and the parent doesn't like it:

21891 write(1, "You shouldn\'t call /sbin/update-"..., 81) = 81
21884 <... read resumed> "You shouldn\'t call /sbin/update-"..., 4096) =
81
21884 write(7, "20 Unsupported command \"you\" (fu"..., 154) = 154

this is what eventually causes the exit 128.

the real problem is the kernel .postrm mechanisms which are spawning
a zillion children with stdout still hooked up to the IPC mechanism.
please dup stderr ontop of stdout and reopen stdin from /dev/null for
children.

so why is the .postrm invoking /sbin/update-grub?  in my case it's
because of the contents of my /etc/kernel-img.conf:

postinst_hook = update-grub
postrm_hook   = update-grub

despite the fact that /sbin trails /usr/sbin in my PATH there's code in
.postrm which overrides the PATH:

    for my $path ('/bin', '/sbin', '/usr/bin', '/usr/sbin') {
      if (-x "$path/$script") {
        &exec_script($type, "$path/$script");
        return 0;
      }
    }

thus ensuring that the silly /sbin/update-grub wrapper is invoked.

the grub package suggests those hooks should refer to
/usr/sbin/update-grub -- which would stop the kernel .postrm from screwing
up (but would hide the stdin/out IPC bug).

my most recently freshly installed box (from etch beta3 installer) has
a kernel-img.conf without the full pathnames on update-grub... i'm not
sure who is responsible for messing those up.  maybe this is fixed in
rc1 installer?  dunno.

anyhow, to summarize:

- kernel .postrm script needs to be more careful with its spawned
  children so as to not screw up its IPC mechanism

- something messed up /etc/kernel-img.conf and didn't put the /usr/sbin
  paths on the hooks... if someone has a rc1-installed box please take
  a peek in there to see if it has been fixed.

-dean



Reply to: