On Sun, 25 Oct 2015 15:11:01 +0100 Jona Joachim <j...@joachim.cc> wrote:
> Hi, > I was tired of CUPS so I decided keep it simple and stupid and use > lpd/lpr. Strangely, things don't work out as expected. It seems that > lpd never executes input filters. > > Here is the content of /etc/printcap: > lp|hl6050|Brother HL6050:\ > :lp=:rm=hl6050.lan:\ > :if=/home/jaj/bin/printbrother.sh:\ > :sh: > > mg3150|canon|Canon MG3150:\ > :lp=:rm=canon.lan:\ > :if=/home/jaj/bin/printcanon.sh:\ > :sh: > > Here is the content of printcanon.sh: > #!/bin/sh > > logger "printcanon called $@" > > /usr/local/bin/a2ps -BRq --columns=1 -o - | \ > /usr/local/bin/foomatic-rip -q -P Canon-PIXMA-MG3150 \ > --ppd /home/jaj/bin/Canon-PIXMA-MG3150-ijs-simplified.ppd > > printbrother.sh is the same except for driver and ppd. > Both scripts are executable. > I never see the "printcanon called" message in syslog and the printers > get incorrect data. The first printer understands a subset of > postscript so it prints fine, the second printer however does not. > If I run a document manually through the filter and the enqueue it to > lpr, the printers are more than happy to print. > > I see no error nowhere. > > $ cat /var/log/lpd-errs > Oct 25 07:47:01 asterix lpd[9652]: restarted > Oct 25 14:57:06 asterix lpd[17953]: restarted > > $ cat /var/spool/output/lpd/status > sending to hl6050.lan > > I went through the code of lpd to see where things could go wrong but > it's a bit complex and I couldn't understand the bits. > > Does anybody know where I could look to solve this? > > Best regards, > Jona > What little I ever knew about LPRng has vanished from my memory, but I have some suggestions. Before anything else, back up your existing /etc/printcap so you can experiment to your heart's content and still go back to what you have. Next, just for fun, use the ps command to verify that lpd is running in the background. Better yet, kill the background lpd, run it in the foreground, and watch the messages it scrolls. Create a new printcap, with exactly one printer, lp_test, that's the simplest possible printer queue. If possible, give it only one property: an if script that prints a timestamp and then the contents of the document to /tmp/junk.log. If in fact the prior two mentioned tests support your findings that lpd never runs the stuff in printcap at all, experiment with printcap permissions. Also, now that you're running lpd in the foreground on a command prompt, experiment with different options to the lpd command. In your description, you say input filters are never executed, and later says that you never seethe "printcanon called". If you ever see "printbrother called", then you can exploit the differences by changing the two print queues to ever more resemble each other, until either both malfunction in the same way, or both work. At that point, you know what you did to flip the symptom. HTH, SteveT Steve Litt October 2015 featured book: Thriving in Tough Times http://www.troubleshooters.com/thrive