On Thu, 21 Jan 1999 11:27:13 -0500, "Robert H. Thompson"
>Hello all,
>I am new to the list and new to linux (redhat 5.2) and I've just got a
>two node network up and running. I was wondering if anyone has tried to
>print from a linux machine to a win95 printer?
>The linux box is the server. Win95 the client. Samba is configured and
>the win95 can access the linux hard drive and it shows up in Network
>nehigborhood. I ran across some docs about modifing the printcap file
>and have done so. The lp shows up in Network neghiborhood also but I
>can't print (lp) to the network printer.
Here's how I do it...
/etc/printcap contains:
# Remote Printer - Epson LQ-570 on Bitsie (SMB support)
smb_epson:\
:lp=/dev/null:\
:sd=/usr/spool/bitsie.epson:\
:if=/usr/local/sbin/smbprint:\
:af=/usr/spool/bitsie.epson/acct:\
:sh:
/usr/spool/bitsie.epson contains:
1 -rw-r--r-- 1 root root 40 Oct 18 14:03 .config
1 -rw-r----x 1 root lp 4 Jan 20 22:06 .seq
1 -rw-r-xr-- 1 root root 3 Jan 21 12:17 lock
1 -rw-rw-r-- 1 root root 18 Jan 20 22:06 status
/usr/local/sbin/smbprint has the following permissions...
3 -rwxr-xr-x 1 root lp usr/local/sbin/smbprint
/usr/local/sbin/smbprint contains:
logfile=/tmp/smb-print.log
eval acct_file=\$$#
spool_dir=`dirname $acct_file`
config_file=$spool_dir/.config
eval `cat $config_file`
echo "server $server, service $service" >> $logfile
(
echo "print -"
cat
# next line wraps on display, and shows as two lines
) | /usr/local/samba/bin/smbclient "\\\\$server\\$service"
$password -U $server -N -P >> $logfile
/usr/spool/bitsie.epson/.config contains:
server=Bitsie
service=epson
password=""
In the above .config file, Bitsie is the ComputerName of my Win95
system (set in Control Panel / Network / Identification), and epson is
the name of my shared printer. Since I've not password protected
the resource, the password is empty.
Both the Win95 system (Bitsie) and Linux system (Merlin) belong to the
same Samba workgroup. epson is (as the comments in /etc/printcap
suggest) an Epson LQ570 24-pin dot-matrix printer.
I hope this helps...
Lew Pitcher
System Consultant, Systems Research and Development
Toronto Dominion Bank
(Opinions expressed are my own, not my employers')