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

Re: printer trouble (solved)



> 
> On Fri, 7 Nov 1997, E.L. Meijer (Eric) wrote:
> 
> > Hello everyone,
> 
> Hi!
> 
> > 
> > I recently got a problem with a printer filter used by lpr.  The filter
> > is used for a HP Deskjet 870 cxi, and used to work properly on this
> > machine, and still does on other machines:
> > 
> > The princap entry is [OMITTED]
> > 
> > The filter /etc/filters/filter870.ps looks like:
> > ------------------------------------------------------------------------
> > #!/bin/sh
> > 
> > /usr/bin/gs     -sDEVICE=cdj550 \
> >                 -q \
> >                 -r300x300 \
> >                 -sPAPERSIZE=a4 \
> >                 -dNOPAUSE \
> >                 -dSAFER \
> >                 -sOutputFile=- \
> >                 - | \
> > lpr -Php870raw
> > ------------------------------------------------------------------------
> > 
> > hp870raw is a remote printer.  The problem might be caused by the
> > fact that gs was recently replaced with Alladin-gs, version 4.03-7.  If
> > I run `lpr -Pcol1 bla.ps', I see with ps -eaxfwww that gs is run with
> > the following arguments:
> > /usr/bin/gs -sDEVICE=lvga256 -sDEVICE=cdj550 -q -r300x300 -sPAPERSIZE=a4 ...
> >              ^^^^^^^^^^^^^^^
> > It doesn't stop, and nothing gets printed.
> > 
> > Now who or what put -sDEVICE=lvga256 there?  I printed the environment
> > from the filter, and did not see a GS_DEVICE variable.  I tried to set
> > the GS_DEVICE variable in the filter, but it didn't help.  
> 
> It is gs that put -sDEVICE=lvga256 there! In fact, /usr/bin/gs is not
> the "real" program, it is just a wrapper, which, in particular,
> adds the parameter above as an then calls /usr/bin.gs.main, whihc
> is the "real" program. The parameter is added when gs thinks that the
> program is running outside X11, so that the svga device is used as the 
> default one (if the fprogram is running under X11, the X device is the 
> default one). 
> 
> In any case, the -sDEVICE=cdj550 overwrites the default device, so this
> is not the cause of the problem.
> 
> > Even more
> > mysterious, if I run `filter870.ps < bla.ps', it works correctly!
> 
> However, this should not work if you execute the script as root
> (In fact i think that the problem occurs since your filter is executed 
> with root permissions).
> 
> If gs is executed with superuser permissions, it tries to initialize the 
> svga library and this produces garbage messages on the stdout
> something like "Svga libraries version xxx.yyy, using virtual console #7";
> these messages are sent to the printer, which gets confused and does not
> print correctly.
> 
> To see if this is the cause of the problem, you can execute
>    filter870.ps < bla.ps 
> as root: it should NOT print correctly.

This is true: it dumps core.  However, when run from lpr, the filter is
run as daemon, not root.  

> Solutions:

[ did not help, since the problem was not superuser permissions ]

I finally got the printer working again via lpr by purging the packages
lpr ghostview gs-aladdin gsfonts (in that order, with dpkg --purge).
Then I reinstalled

gsfonts_4.01-5.deb
ghostview_1.5-16.deb
gs-aladdin_5.03-0.99_i386.deb
ghostview_1.5-16.deb
lpr_5.9-13.1.deb

(yes, the brand new gs-aladdin package from Marco Pistore's home page,
thanks!)

And presto!  It works again after reinstallation of the proper printcap,
and the unchanged filter.  I haven't got the slightest idea what was
wrong, but I'm glad it is fixed again.

Thanks for everyone's comments.

Eric Meijer



-- 
 E.L. Meijer (tgakem@chem.tue.nl)          | tel. office +31 40 2472189
 Eindhoven Univ. of Technology             | tel. lab.   +31 40 2475032
 Lab. for Catalysis and Inorg. Chem. (TAK) | tel. fax    +31 40 2455054


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: