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

Re: gzip and dpkg problem



Paul Schoenly writes ("gzip and dpkg problem"):
...
> $ dpkg --install package_x.deb
...
>    gzip:stdout: Broken pipe
>    dpkg-deb: subprocess gzip -dc returned error exit status 1
>    dpkg: error processing package_x.deb (--install)
>     subprocess dpkg-deb --control returned error exit status 2
>    Errors were encountered... (and so on)

This means that SIGPIPE was set to SIG_IGN when dpkg started.  For
reasons too complicated to explain here this means that dpkg can't do
proper error trapping (it always gets an error indication, and can't
tell whether it's really an error).

This is a bug in one of:
  Your inetd, telnetd, rlogind, if you're logging in over the
    network (some versions of the Debian netbase and/or netstd
    packages had this problem).
  Your shell (I know of no shells that cause this problem).
  The getty you're using.
    (Some versions of getty_ps are known to have this problem.)
  The login you're using (I know of no problem here).
  Any program which started one of the above, or which is in
    the calling chain for dpkg.

...
>  dpkg-deb --fsys-tarfile xxx.deb > xxx.tar and dpkg-deb -e xxx.deb to
>    get the package contents and control files installed and processed
>    (this *will* work but it's a hassle)

This *won't* work - it won't properly install the packages.

In case you're truly desperate, I've attached a Perl script which
resets SIGPIPE to SIG_DFL and then runs the command you supply as
arguments.  Use it like `nohup' or `time'.  I call it `resetsigpipe'
(and I need it because my serial terminal is on getty_ps, which has
the bug).

Please do tell us what the problem is if you find out.  Telling us
which ways of logging in cause the problem and which don't will help
us a lot :-).  If you don't want to bother trying to install packages
(and it sometimes works even if the bug is present), try:
  cat /dev/zero | true
If the bug isn't present this produces just `Broken pipe' (assuming
you're using bash as your shell).  If the bug is present it will
produce `cat: write error: Broken pipe'.

Alexander Goldstein writes ("Re: gzip and dpkg problem"):
...
> I also often have the same problem sometimes (with some packages).  It
> only happens when su-ing to root.  To bypass it, I just login directly as
> root on a VC.  I have 1.1 system and it happened with all versions of dpkg
> including as far way back as .96R6.

Huh ?  `su' does this ?  I don't believe it ...

... no, `su' doesn't.  Perhaps you have `sudo' or something else in
the calling chain.

Please try to identify what it is that's causing the problem, so that
we can fix it and/or tell others to avoid it :-).

Thanks,
Ian.

Here's resetsigpipe, a Perl one-liner:

#!/usr/bin/perl
$SIG{"PIPE"}="DFL"; exec @ARGV; die "resetsigpipe: $ARGV[0]: $!\n";


Reply to: