UNIX --> NT printing

UNIX --> NT printing

Post by ch.. » Tue, 13 Jun 2000 04:00:00



I would like to send print jobs from my FreeBSD machines to a printer connected
to an NT box.

I have been trying to use the smbprint tool, and have followed the
recommendations in the O'Reilly Using Samba book. I have not had much success.
I have the following as my /etc/printcap file:

-------------------------
#
# /etc/printcap for host
#
smb|lp:\
        :sd=/var/spool/lpd/smb:\
        :if=/usr/local/etc/smbprint:\
        :mx=0:\
        :lf=/var/log/lpd-errs.log:\
        :sh:
--------------------------

I placed the following .config file in /var/spool/lpd/smb/

--------------------------
server = lauter
service = laserjet
password = ""
--------------------------

Print jobs get spooled, but when I view the queue with lpq I see a Warning:
no daemon present message. But lo, lpd is definitely running.

I have been able to print stair-stepped text files to the printer using
smbclient.

The examples in the Using Samba book are not geared toward domain-level
security, which I have. (I am authenticating smb users with an NT Server.)
I now suspect the smbprint script is not designed for my particular
setup. I would think this kind of setup (UNIX client printing to NT print-
server) is not uncommon.

Here is my smbprint script:
---------------------------

#!/bin/sh

# This script is an input filter for printcap printing on a unix machine. It
# uses the smbclient program to print the file to the specified smb-based
# server and service.
# For example you could have a printcap entry like this
#
# smb:lp=/dev/null:sd=/usr/spool/smb:sh:if=/usr/local/samba/smbprint
#
# which would create a unix printer called "smb" that will print via this
# script. You will need to create the spool directory /usr/spool/smb with
# appropriate permissions and ownerships for your system.

# Set these to the server and service you wish to print to
# In this example I have a WfWg PC called "lapland" that has a printer
# exported called "printer" with no password.

#

# so that the server, service, and password can be read from
# a /usr/var/spool/lpd/PRINTNAME/.config file.
#
# Script further modified by Richard Sharpe to fix some things.
# Get rid of the -x on the first line, and add parameters
#
#    -t  now causes translate to be used when sending files
#
# In order for this to work the /etc/printcap entry must include an
# accounting file (af=...):
#
#   cdcolour:\
#       :cm=CD IBM Colorjet on 6th:\
#       :sd=/var/spool/lpd/cdcolour:\
#       :af=/var/spool/lpd/cdcolour/acct:\
#       :if=/usr/local/etc/smbprint:\
#       :mx=0:\
#       :lp=/dev/null:
#
# The /usr/var/spool/lpd/PRINTNAME/.config file should contain:
#   server=PC_SERVER
#   service=PR_SHARENAME
#   password="password"
#
# E.g.
#   server=PAULS_PC
#   service=CJET_371
#   password=""

#
# Debugging log file, change to /dev/null if you like.
#
logfile=/var/log/smb-print.log

# logfile=/dev/null

#
# The last parameter to the filter is the accounting file name.
#   Extract the directory name from the file name.
#   Concat this with /.config to get the config file.
#
TRANS=0
eval acct_file=\${$#}
spool_dir=`dirname $acct_file`
config_file=$spool_dir/.config

# Should read the following variables set in the config file:
#   server
#   service
#   password
eval `cat $config_file`

while getopts t c; do
  case $c in
    t)
       TRANS=1
       ;;

    '?')  # Bad parameters, ignore it ...
       ;;
  esac
done
#
# Some debugging help, change the >> to > if you want to same space.
#
echo "server $server, service $service" >> $logfile

(
# NOTE You may wish to add the line `echo translate' if you want automatic
# CR/LF translation when printing.
        if [ $TRANS -eq 1 ]; then
          echo translate
        fi
        echo "print -"
        cat
) | /usr/local/bin/smbclient "\\\\$server\\$service" $password -U $server -N -P >> $logfile
----
Christopher Farley
Northern Brewer / 1150 Grand Avenue / St. Paul, MN 55105
www.northernbrewer.com

 
 
 

UNIX --> NT printing

Post by ch.. » Wed, 14 Jun 2000 04:00:00


I would like to send print jobs from my FreeBSD machines to a printer connected
to an NT box.

I have been trying to use the smbprint tool, and have followed the
recommendations in the O'Reilly Using Samba book. I have not had much success.
I have the following as my /etc/printcap file:

-------------------------
#
# /etc/printcap for host
#
smb|lp:\
        :sd=/var/spool/lpd/smb:\
        :if=/usr/local/etc/smbprint:\
        :mx=0:\
        :lf=/var/log/lpd-errs.log:\
        :sh:
--------------------------

I placed the following .config file in /var/spool/lpd/smb/

--------------------------
server = lauter
service = laserjet
password = ""
--------------------------

Print jobs get spooled, but when I view the queue with lpq I see a Warning:
no daemon present message. But lo, lpd is definitely running.

I have been able to print stair-stepped text files to the printer using
smbclient.

The examples in the Using Samba book are not geared toward domain-level
security, which I have. (I am authenticating smb users with an NT Server.)
I now suspect the smbprint script is not designed for my particular
setup. I would think this kind of setup (UNIX client printing to NT print-
server) is not uncommon.

Here is my smbprint script:
---------------------------

#!/bin/sh

# This script is an input filter for printcap printing on a unix machine. It
# uses the smbclient program to print the file to the specified smb-based
# server and service.
# For example you could have a printcap entry like this
#
# smb:lp=/dev/null:sd=/usr/spool/smb:sh:if=/usr/local/samba/smbprint
#
# which would create a unix printer called "smb" that will print via this
# script. You will need to create the spool directory /usr/spool/smb with
# appropriate permissions and ownerships for your system.

# Set these to the server and service you wish to print to
# In this example I have a WfWg PC called "lapland" that has a printer
# exported called "printer" with no password.

#

# so that the server, service, and password can be read from
# a /usr/var/spool/lpd/PRINTNAME/.config file.
#
# Script further modified by Richard Sharpe to fix some things.
# Get rid of the -x on the first line, and add parameters
#
#    -t  now causes translate to be used when sending files
#
# In order for this to work the /etc/printcap entry must include an
# accounting file (af=...):
#
#   cdcolour:\
#       :cm=CD IBM Colorjet on 6th:\
#       :sd=/var/spool/lpd/cdcolour:\
#       :af=/var/spool/lpd/cdcolour/acct:\
#       :if=/usr/local/etc/smbprint:\
#       :mx=0:\
#       :lp=/dev/null:
#
# The /usr/var/spool/lpd/PRINTNAME/.config file should contain:
#   server=PC_SERVER
#   service=PR_SHARENAME
#   password="password"
#
# E.g.
#   server=PAULS_PC
#   service=CJET_371
#   password=""

#
# Debugging log file, change to /dev/null if you like.
#
logfile=/var/log/smb-print.log

# logfile=/dev/null

#
# The last parameter to the filter is the accounting file name.
#   Extract the directory name from the file name.
#   Concat this with /.config to get the config file.
#
TRANS=0
eval acct_file=\${$#}
spool_dir=`dirname $acct_file`
config_file=$spool_dir/.config

# Should read the following variables set in the config file:
#   server
#   service
#   password
eval `cat $config_file`

while getopts t c; do
  case $c in
    t)
       TRANS=1
       ;;

    '?')  # Bad parameters, ignore it ...
       ;;
  esac
done
#
# Some debugging help, change the >> to > if you want to same space.
#
echo "server $server, service $service" >> $logfile

(
# NOTE You may wish to add the line `echo translate' if you want automatic
# CR/LF translation when printing.
        if [ $TRANS -eq 1 ]; then
          echo translate
        fi
        echo "print -"
        cat
) | /usr/local/bin/smbclient "\\\\$server\\$service" $password -U $server -N -P >> $logfile
----
Christopher Farley
Northern Brewer / 1150 Grand Avenue / St. Paul, MN 55105
www.northernbrewer.com

 
 
 

UNIX --> NT printing

Post by Stefan Kantha » Wed, 14 Jun 2000 04:00:00




Quote:> I would like to send print jobs from my FreeBSD machines to a printer
connected
> to an NT box.

---cut---

Do it native: install the "TCP/IP print service" (aka LPD) on your NT box
and use lpr to print from Unix. If in doubt, search the Microsoft Knowledge
Base how to setup both NT and Unix.

regards
Stefan

 
 
 

UNIX --> NT printing

Post by Peter J Arnol » Wed, 14 Jun 2000 04:00:00





> > I would like to send print jobs from my FreeBSD machines to a printer
> connected
> > to an NT box.
> ---cut---

> Do it native: install the "TCP/IP print service" (aka LPD) on your NT box
> and use lpr to print from Unix. If in doubt, search the Microsoft Knowledge
> Base how to setup both NT and Unix.

> regards
> Stefan

You may also need to set a registry setting on the NT box as per
http://www.ntfaq.com/ntfaq/printing17.html

I had to do this before my solrais box could print through NT. On
solaris you just set up a remote queue giving it server name and printer
queue...

HTH
--
Peter Arnold
+---------------------------+-----------------+

| Brisbane, Qld, Australia  | To moo bovine.  |
+---------------------------+-----------------+

 
 
 

UNIX --> NT printing

Post by ch.. » Wed, 14 Jun 2000 04:00:00




>> Do it native: install the "TCP/IP print service" (aka LPD) on your NT box
>> and use lpr to print from Unix. If in doubt, search the Microsoft Knowledge
>> Base how to setup both NT and Unix.

> You may also need to set a registry setting on the NT box as per
> http://www.ntfaq.com/ntfaq/printing17.html

Thanks-- I got it working with TCP/IP print service. I started down this
smbprint path because I was having issues with TCP/IP print service. I
failed to realize you had to start the service after installing it. I kind of
figured that NT would have taken care of that during the required reboot.

--
----
Christopher Farley
Northern Brewer / 1150 Grand Avenue / St. Paul, MN 55105
www.northernbrewer.com

 
 
 

UNIX --> NT printing

Post by Stefan Kantha » Wed, 14 Jun 2000 04:00:00




Quote:> I would like to send print jobs from my FreeBSD machines to a printer
connected
> to an NT box.

---cut---

Do it native: install the "TCP/IP print service" (aka LPD) on your NT box
and use lpr to print from Unix. If in doubt, search the Microsoft Knowledge
Base how to setup both NT and Unix.

regards
Stefan

 
 
 

UNIX --> NT printing

Post by Soren Dayto » Sat, 17 Jun 2000 04:00:00






> > > I would like to send print jobs from my FreeBSD machines to a printer
> > connected
> > > to an NT box.
> > ---cut---

> > Do it native: install the "TCP/IP print service" (aka LPD) on your NT box
> > and use lpr to print from Unix. If in doubt, search the Microsoft Knowledge
> > Base how to setup both NT and Unix.

> > regards
> > Stefan

> You may also need to set a registry setting on the NT box as per
> http://www.ntfaq.com/ntfaq/printing17.html

Wow.  That's something that I've been looking for for a while.  Here's
my next question: is there a way to force simplex versus duplex
printing on a windows server?

That is, I have two separate unix printers.  One simplex, one duplex.
How do I make a similar configuration (or what's the right thing to
do?) on the windows side?

Soren

 
 
 

1. Printing NT w/s > NT srv > Unix > Lexmark

We are suffering from very slow printing. I think that the actual
printing itself is quick, but when Word opens a document or when the
print pop-up is requested it takes 5-10 minutes to appear and then, to
change printer takes a very long time. When the little printer
icon indicates that it is actually printing, the busy light on the
printer starts flashing almost immediately.

We have a number of NT4 workstations looked after by an NT4 PDC and
backup.  Our printers (HP and Lexmark) are driven from 2 Solaris 7
machines, one for HP and one for Lexmark.  The NT backup server looks
after the printers for the PCs and sends the requests to Solaris with
Samba 2.0.7.  The printer drivers are set up on the NT server, rather
than on each PC.  It is my impression that the slowness is when PC apps,
such as Word, ask for information about the printer. The printing on
the Solaris side works fine, including from smbclient.

When things are running slowly I can see lpstat being constatly run on
the Samba server, in response to requests coming over the net from the
NT server.  It is variable, sometimes the response is very fast and
lpstat is not to be seen running on the Samba server.

On the NT server it appears that the Lexmark software has been installed
to drive the printers (Markvision), along with the printer drivers
needed by the PCs.  Among the services running on the server is LexBce
which is closely coupled with the spooler.  (Stopping one, stops the
other)

I get the impression that the Lexmark software is being too clever
and getting in the way on the NT server.

Is the concept of using the NT server to supply the drivers, while
passing on the print request via Samba, ok? One down side is that
the print request is handled as administrator on the NT server,
which is then executed as the guest account on Solaris.

Thank you for any help or advice

Geoff Gibbs
--
UK-Human Genome Mapping Project-Resource Centre,
Hinxton, Cambridge, CB10 1SB, UK

2. Reinstalling Solaris on Ultra Enterprise

3. Printing problem (from UNIX->NT->Win95 server)

4. need config file help (so what else is new)

5. Printing Problem from NT -> UNIX(FreeBSD)

6. SmartSuite and Lotus Notes

7. probs printing from unix sys5 -> NT

8. NT->UNIX->WWW? SMB or NFS?

9. connect UNIX->PC->UNIX

10. Iris to NT - all NT users to print , only some to see UNIX file system

11. Iris to NT - all NT uses to print , only some to see UNIX file system

12. Help with Win->Unix printing