Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Feb 2002 23:39:37 -0800
From:      "Timothy L. Robertson" <timothyr@timothyr.net>
To:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   LPRng and /dev/null
Message-ID:  <B8949E39.B890%timothyr@timothyr.com>

next in thread | raw e-mail | index | archive | help
Hi Everyone,

I'm trying to set up my 4.5 box as a print server to a Windows GDI printer
using RedMon and GhostScript.  I've got it working so that if I do

   cat file.ps | /usr/local/libexec/filters/gs_9700_smb > /dev/null

Things work fine.  (gs_9700_smb is a filter which sends the file over smb to
the windows box.  Included below.)

I installed LPRng from ports, and have a very simple printcap file:

lp:
      :lp=/dev/null
      :sd=/var/spool/lpd/lp
      :filter=/usr/local/libexec/filters/gs_9700_smb

But when I try to print a file I get:

scarlet:~/prl 478$ lp test.ps
lpr: connect: No such file or directory
jobs queued, but cannot start daemon.

Using checkpc, the LPRng diagnostic program gives

scarlet:/home/timothyr 501# checkpc
2002-02-16-23:33:36.457 scarlet lp: Checkwrite: fcntl F_SETFL of '/dev/null'
failed - Operation not supported by device
Warning - lp: cannot open lp device '/dev/null' - No Error

Which looks to me like it's saying /dev/null doesn't act like a printer port
in some way.  Any suggestions on how to make this work?

Thanks,
-Tim
timothyr@timothyr.com

scarlet:/home/timothyr 502# cat /usr/local/libexec/filters/gs_9700_smb
#!/bin/sh
# Print from Unix on a printer on SMB network.
#
client="DARKSTAR"   # client name here...
pshare="GS9700"    # and here printer share name
printfile="/tmp/smbspool.$$"

cat > $printfile
if [ -s $printfile ] ; then
  ( echo "translate" ; echo "print $printfile" ; echo "quit" ) \
  | smbclient \\\\$client\\$pshare printerpasswd -U printer -P -N
fi
rm -f $printfile
exit 0



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B8949E39.B890%timothyr>