[comp.sys.sun] Exclusive lock on /dev/null

jet@karazm.math.uh.edu (J. Eric Townsend) (07/03/90)

How do I circumvent this?  I'm using the KIP/CAP software to drive laser
printers, which requires tricking lpd into sending all of its data to the
input filter and never seeing it again.  Part of this includes telling it
the printing device is /dev/null.  If I want to print on two different
printers at the samet time, one has to wait because the other has an
exclusive lock on /dev/null.

It seems odd to me that SunOS allows you to get an exclusive lock on the
bit bucket...

J. Eric Townsend -- University of Houston Dept. of Mathematics (713) 749-2120
Internet: jet@uh.edu
Bitnet: jet@UHOU
Skate UNIX(r)

dudek@ksr.com (Glen Dudek) (07/06/90)

In article <9540@brazos.Rice.edu> jet@karazm.math.uh.edu (J. Eric Townsend) writes:
>
>How do I circumvent this?  I'm using the KIP/CAP software to drive laser
>printers, which requires tricking lpd into sending all of its data to the
>input filter and never seeing it again.  Part of this includes telling it
>the printing device is /dev/null.  If I want to print on two different
>printers at the samet time, one has to wait because the other has an
>exclusive lock on /dev/null.

I had the same problem when we upgraded to Sun OS 4.0.3 - I worked around
it by creating a device for each printer which has the same major and
minor device number as /dev/null, e.g.

    mknod /dev/laserwriter1 c 3 2

Since the exclusive lock is on the inode, having a separate inode for each
printer solves the problem.

	Glen Dudek
	dudek@ksr.com

guy@uunet.uu.net (Guy Harris) (07/08/90)

>I had the same problem when we upgraded to Sun OS 4.0.3 - I worked around
>it by creating a device for each printer which has the same major and
>minor device number as /dev/null,

The same issue came up on the "sun-managers" list; one of the
correspondents (not a relative, as far as I know :-)) claims there is an
even easier solution:

X-From: Michael Harris - NYC SE <uunet!east.sun.com!michael.harris>
X-Subject: Re:  Lock on /dev/null
...

Make the lp entries in printcap null instead of /dev/null or dummy files
like this:

ps|lp|lw|postscript|PostScript:\
        :lp=:\
        :rm=lprhost:\
        :rp=lp:\
        :sd=/var/spool/ps:\
        :lf=/var/spool/ps/ps-log:

It works fine.

HTH
mh