DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 12th March 2014
spacebar_permissions spacebar_permissions is offline
New User
 
Join Date: Nov 2013
Posts: 4
Thanked 0 Times in 0 Posts
Default Network Print Err - lpr: cannot open /var/spool/output/lpd/.seq: No such file or dir

Subject should be: Network Printing, no output or errors from "lpr 'filename' ".

DaemonForums,

Running "lpr 'filename' ", I'm unable to print using the LPD printer daemon on a laptop (Dell Inspiron 11z, OpenBSD 5.4 Release w/patched source, amd64) to a standalone Canon Imageclass D1150. There is no error afterwards running the above command, nor is there any output from "tail -f /var/log/lpd-errs".


Running "lpc status" gives:

"queueing is enabled
printing is enabled
no entried
printer idle"


Here is my printcap file:

lp|canon:\
:sh=:\
:lp=515@192.168.xxx.xxx:\
:sd=/var/spool/output/canon:\
:lf=/var/log/lpd-errs:\
:rp=canon:

*I've set the printer's hostname to "canon" (when ping-ed by name replies with correct IP address)

*The IP address above contains the true static address I've set on the printer, and the hosts.lpd file contains "canon".

*/var/spool/output/canon has rwx for all, owner=root, group=daemon

*/var/log/lpd-errs shows log info when I restart lpd, but nothing else even when I run "lpr filename".

*rp=remote printer name (assuming host or device name, I've set both to "canon").

I basically followed "Absolute OpenBSD (M Lucas)" (page 306) format, but replaced his "rm=printservername:\" with my "lp=515@192.168.xxx.xxx:\". My understanding is his example points to a print server with printer attached, as opposed to a standalone printer.



Other notes:

I verified with the Canon D1150 manual that it does support LPD, also logged into http interface and verified that LPD is turned on and using port 515.

Ran "nc -z 192.168.xxx.xxx 515" gives "Connection to 192.168.xxx.xxx 515 port (tcp/printer] succeeded!"

I realize I haven't applied any filtering, but am I wrong to believe there would be some response or garbled print output if "lpr 'filename' " is run?

A point in the right direction would be greatly appreciated.

--spacebar_permissions

Last edited by spacebar_permissions; 12th March 2014 at 04:52 AM. Reason: Pls change subject.
Reply With Quote
  #2   (View Single Post)  
Old 12th March 2014
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,683
Thanked 214 Times in 189 Posts
Default

  1. You can inspect traffic between your lpd server and the printer with tcpdump(8).
  2. When I have used lpd(8) with a network printer, I have always a) set lp to null, and b) set rm to the network address of the printer, as highlighted in the example below. I have never used /etc/hosts.lpd.

    This particular example used foomatic-rip (a component of print/cups-filters) to pass a PPD file to a Postscript printer.
Code:
lp|printer:\
    :lp=:rm=printer:\
    :af=/etc/foomatic/hp-lj_300_400_color_m351_m451-ps.ppd:\
    :if=/usr/local/bin/foomatic-rip:\
    :sh:mx#0:\
    :sd=/var/spool/output:\
    :lf=/var/log/lpd-errs:
Reply With Quote
  #3   (View Single Post)  
Old 12th March 2014
spacebar_permissions spacebar_permissions is offline
New User
 
Join Date: Nov 2013
Posts: 4
Thanked 0 Times in 0 Posts
Default 1 entry in spool area, unable to resolve remote machine, tcpdump next

jggimi,

Thank you for your help! I'm a step closer (print jobs are sitting in the print queue), my next step is inspecting traffic with tcpdump.

Running "lpq -l" gives:

Warning: unable to resolve remote machine 515@192.168.xxx.xxx: no address associated with name no entries
... and list of print jobs.

I removed all print jobs in the queue using "lprm job#", running "lpq -l" no longer shows print jobs, but still shows unable to resolve remote machine error. "nc -z IP addr port#" still shows connection succeeded. Again, I'm going to inspect traffic next.


Other notes:

I changed my ":lp=515@192.168.xxx.xxx:\" line to ":lp=:rm=515@192.168.xxx.xxx:\", understanding that setting lp to null means ":lp=:" and setting rm to network address of printer means "rm=515@192.168.xxx.xxx".

I removed the "canon" directory from /var/spool/output, set ":sd=/var/spool/output:\"

I removed the "canon" line in /etc/hosts.lpd. The lpd manual says that file is for listing machine names allowed printer access; appears to be for allowing remote hosts in the list, not a printer, as I incorrectly interpreted.


I'll report back with resolution and/or traffic analysis.

Thanks again!

--spacebar_permissions
Reply With Quote
  #4   (View Single Post)  
Old 12th March 2014
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,683
Thanked 214 Times in 189 Posts
Default

While it may not make any difference, I don't believe you need to use the port number. In particular, the warning message "unable to resolve remote machine..." indicates to me that the port number should not be used, or you have something else going on with your addressing schema.

If you place your printer's host name and IP address in your resolver database (e.g.: /etc/hosts or a local DNS server if used), you can use a host name as I did in my example.

There's no need to redact RFC1918 addresses as you have done in this thread. Only "real" IP addresses should be redacted for public discussion.

edited to add:

Unless... you're actually using "192.168.xxx.xxx" in your /etc/printcap file? That's an invalid IP address.

Last edited by jggimi; 12th March 2014 at 04:11 PM. Reason: rethinking: redaction may be a syntax error
Reply With Quote
  #5   (View Single Post)  
Old 12th March 2014
shep shep is offline
ISO Quartermaster
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 592
Thanked 9 Times in 9 Posts
Default

The forums helped me transition from cups to lpd. I have also found this lpd printing guide by a FreeBSD forums moderator to work well in OpenBSD. His observation that port 9100 worked better than lpd, http, https held true for my Trendnet print server. The other comment is the syntax of the port:
Code:
192.168.1.2:9100
worked as a cups entry but not with lpd
Code:
9100@192.168.1.2
works for JetDirect in lpd but I am not sure if the same syntax works for http or lpd.

I set up my first printcap using print/apsfilter which will setup your spool directory, with proper ownership and permissions and generates the printcap with filter. Subsequently, I have been following Wblock's FreeBSD printing guide to generate my own print filter and am presently using
Code:
lp|hp5l|ljet4;r=300x300;q=medium;c=gray;p=letter;m=auto:\
    :lp=9100@192.168.1.2:\
    :rp=raw:\
    :if=/usr/local/libexec/ps2pcl:\
    :sd=/var/spool/lpd/hp5l:\
    :lf=/var/spool/lpd/hp5l/log:\
    :af=/var/spool/lpd/hp5l/acct:\
    :mx#0:\
    :sh:
By using the numeric IP address, I avoided having to make an /etc/hosts or DNS entry.
I can also name my spool directory after an lp aliasis:
Code:
:sd=/var/spool/lpd/hp5l:\
When I setup 5.5, I am going to try jggimi's entry for foomatic filters

Last edited by shep; 12th March 2014 at 04:37 PM. Reason: Corrected print/apsfilter link
Reply With Quote
  #6   (View Single Post)  
Old 12th March 2014
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,683
Thanked 214 Times in 189 Posts
Default

Shep, I don't want to derail this thread, so I'll just note that I ended up transitioning back the other way, see http://marc.info/?t=139326008100005&r=1&w=2 for details.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
pf.conf output to bruteforce file dbach FreeBSD General 2 31st December 2011 01:35 AM
echo and print ? sharris FreeBSD General 1 4th September 2011 06:25 AM
output to a file in java c0mrade Programming 4 15th October 2009 07:55 AM
C and file input/output 18Googol2 Programming 3 20th August 2008 04:02 PM
Network failure and output dumping onto console JMJ_coder NetBSD General 17 17th May 2008 02:27 AM


All times are GMT. The time now is 01:11 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick