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 11th November 2019
girarde girarde is offline
Fdisk Soldier
 
Join Date: Nov 2010
Location: NW FL
Posts: 57
Default Printing, the problem that never dies

I hate printing. I first hated printing in the 90s, when setting up printers on NetWare 2 required that the driver be linked into the network client on the box. I mean linked with a linker.

Windows made it better, but not that much better, since I've been working secure environments for decades now and Extra Steps must be taken.

But OpenBSD printing has taken the cake.

I got a free Lexmark c540 (color laser) and decided to try again. Still no success. My printcap looks like this:
# $OpenBSD: printcap,v 1.2 2016/03/05 16:24:56 ajacoutot Exp $

lp|lexmark:\\\ :lp=9100@192.168.1.138:\\\ :af=/etc/foomatic/direct/Lexmark-C540-Postscript-Lexmark.ppd:\\\ :if=/usr/local/bin/foomatic-rip:\\\ sh:sd=/var/spool/output:lf=var/log/lpd-errs:

The PPD file was downloaded from Lexmark, so I think it's kind of official.

Trying to print with lpr (I am not using CUPS) results in:

lpr: cannot open /var/spool/output/.seq: Permission denied

@mwlucas advised checking out apsfilter.org in his marvelous Absolute OpenBSD, but that site is down.

So what do people who can print *do*? There is so much ...nuance, yes, nuance is the nice word, in advice on printing.

I haz the angry.
Reply With Quote
  #2   (View Single Post)  
Old 11th November 2019
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,907
Default

Was lpd(8) started?

I used to use foomatic-rip with a ppd file, but several years ago went back to using CUPS in order to obtain better print integration with Gtk applications.

Instructions for using foomatic-rip with lpr/lpd are in the pkg-readme for cups-filters.
Reply With Quote
  #3   (View Single Post)  
Old 11th November 2019
johnR johnR is offline
Fdisk Soldier
 
Join Date: Nov 2017
Posts: 49
Default

Quote:
Originally Posted by girarde View Post
lpr: cannot open /var/spool/output/.seq: Permission denied
That line is a clue.
What happens if you change the permission of .seq?

This is working here:
-rw-rw---x 1 daemon daemon ......... .seq

I can't remember if that was the default or if I had to change it. I set it up a couple of years ago and just copied the configuration on subsequent upgrades.
Reply With Quote
  #4   (View Single Post)  
Old 11th November 2019
girarde girarde is offline
Fdisk Soldier
 
Join Date: Nov 2010
Location: NW FL
Posts: 57
Default

Quote:
Originally Posted by johnR View Post
That line is a clue.
What happens if you change the permission of .seq?

This is working here:
-rw-rw---x 1 daemon daemon ......... .seq

I can't remember if that was the default or if I had to change it. I set it up a couple of years ago and just copied the configuration on subsequent upgrades.
.seq does not exist.

perms 'round there:

drwxr-xr-x 3 root wheel 512 Nov 2 14:00 output

lpd is running, as root. Root printing with lpr get the same error.
Reply With Quote
  #5   (View Single Post)  
Old 11th November 2019
johnR johnR is offline
Fdisk Soldier
 
Join Date: Nov 2017
Posts: 49
Default

Quote:
Originally Posted by girarde View Post
.seq does not exist.
That sounds familiar. It reminded me that I had to create a .seq file. I copied the permissions from a Linux system. Not sure if it's the approved OpenBSD method, but it works.

I have a slightly different setup as I'm using a filter file, but here's what I have:
Code:
total 24
drwxrwxr-x  2 root    daemon  512 Nov  9 21:01 .
drwxr-xr-x  3 root    wheel   512 Oct 11  2018 ..
-rw-rw---x  1 daemon  daemon    4 Nov  9 21:01 .seq
-rwxr-xr-x  1 root    daemon  113 Dec  3  2017 filter
-rw-r-----  1 daemon  daemon   35 Nov  9 21:01 lock
-rw-rw----  1 root    daemon   25 Nov  9 21:01 status
'lock', 'status' and '.seq' were written to on the last print run.

Edit: Users can print with the above, but not root.

Last edited by johnR; 11th November 2019 at 10:13 PM.
Reply With Quote
  #6   (View Single Post)  
Old 11th November 2019
girarde girarde is offline
Fdisk Soldier
 
Join Date: Nov 2010
Location: NW FL
Posts: 57
Default

Quote:
Originally Posted by johnR View Post
That sounds familiar. It reminded me that I had to create a .seq file. I copied the permissions from a Linux system. Not sure if it's the approved OpenBSD method, but it works.

I have a slightly different setup as I'm using a filter file, but here's what I have:
Code:
total 24
drwxrwxr-x  2 root    daemon  512 Nov  9 21:01 .
drwxr-xr-x  3 root    wheel   512 Oct 11  2018 ..
-rw-rw---x  1 daemon  daemon    4 Nov  9 21:01 .seq
-rwxr-xr-x  1 root    daemon  113 Dec  3  2017 filter
-rw-r-----  1 daemon  daemon   35 Nov  9 21:01 lock
-rw-rw----  1 root    daemon   25 Nov  9 21:01 status
'lock', 'status' and '.seq' were written to on the last print run.
Just create a 0 byte file?
Reply With Quote
  #7   (View Single Post)  
Old 11th November 2019
johnR johnR is offline
Fdisk Soldier
 
Join Date: Nov 2017
Posts: 49
Default

Further info. My directory structure:
Code:
/var/spool/output
`-- lpd
    |-- .seq
    |-- filter
    |-- lock
    `-- status
Reason for the subdirectory is that I wanted the option of several different filter setups, each with a separate subdirectory. IIRC printing also worked with .seq, filter, lock and status put directly in /var/spool/output, ie. without the extra 'lpd' subdirectory.
Reply With Quote
  #8   (View Single Post)  
Old 11th November 2019
johnR johnR is offline
Fdisk Soldier
 
Join Date: Nov 2017
Posts: 49
Default

Quote:
Originally Posted by girarde View Post
Just create a 0 byte file?
Yes, I think I used 'touch' to create .seq, then set owner and permissions with chown and chmod.

Edit: I also think lock and status might have been generated automatically on the first print run. (I could be wrong - memory isn't perfect).
Reply With Quote
  #9   (View Single Post)  
Old 11th November 2019
johnR johnR is offline
Fdisk Soldier
 
Join Date: Nov 2017
Posts: 49
Default

The printcap(5) manpage refers the reader to the '4.3 BSD Line Printer Spooler Manual' for further information. The 'Unix System Administration Handbook 2nd ed.' also has a good overview of BSD printing (just checked my copy - think I need to do some reading).
Reply With Quote
Old 12th November 2019
girarde girarde is offline
Fdisk Soldier
 
Join Date: Nov 2010
Location: NW FL
Posts: 57
Default

I have the second at the office, the first will need some searching.
Reply With Quote
Old 12th November 2019
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,336
Default

My lpd setup is working with a ppd I generated following the cups-filter pkg-readme. Openprinting.org looks like it is finally getting some attention has 3 ppd"s for your model
https://openprinting.org/printer/Lexmark/Lexmark-C540
/etc/printcap
Code:
#	$OpenBSD: printcap,v 1.2 2016/03/05 16:24:56 ajacoutot Exp $

lp|Brother|HL-5450DN:\
	:lp=9100@192.168.2.3:\
	:if=/usr/local/libexec/br_filter:\
	:sd=/var/spool/output/lpd:\
	:lf=/var/log/lpd-errs:\
	:sh:
/usr/local/libexec/br_filter
Code:
#!/bin/ksh

/usr/local/bin/foomatic-rip --ppd \
 /etc/foomatic/direct/Brother-HL-5450DN-BR-Script3.ppd \
 -o PageSize=Letter -o Duplex=DuplexNoTumble
/var/spool/output
Code:
PooBear$ pwd && ls -al
/var/spool/output
total 12
drwxr-xr-x  3 root  wheel   512 Oct 12 09:34 .
drwxr-xr-x  7 root  wheel   512 Oct 26 15:37 ..
drwxrwxr-x  2 root  daemon  512 Nov 11 20:54 lpd
I usually make a hi-resolution spool and one for envelopes by
Code:
cp -r /var/spool/output/lpd /var/spool/output/lpd_hires
and adding another entry in the printcap.

Code:
lp|Brother|HL-5450DN:\
	:lp=9100@192.168.2.3:\
	:if=/usr/local/libexec/br_filter:\
	:sd=/var/spool/output/lpd:\
	:lf=/var/log/lpd-errs:\
	:sh:
hires|Brother|HL-5450DN:\
	:lp=9100@192.168.2.3:\
	:if=/usr/local/libexec/br_filter_hires:\
	:sd=/var/spool/output/lpd_hires:\
	:lf=/var/log/lpd-errs:\
	:sh:

Last edited by shep; 12th November 2019 at 05:31 AM.
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
William Lowe, the 'father of the IBM PC,' dies at 72 Beastie News 0 29th October 2013 03:25 PM
Processor pioneer Victor Poor dies of cancer at 79 J65nko News 0 21st August 2012 09:01 PM
Problem with printing unicyclist OpenBSD General 8 1st May 2009 07:06 PM
getty dies on serial console? michaelk FreeBSD General 9 18th May 2008 08:44 AM
cyrus-sasl2 dies chavez243 FreeBSD Ports and Packages 9 10th May 2008 03:01 PM


All times are GMT. The time now is 05:29 PM.


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