[Samba] Printing problem

Adrian Keller adrian at msys.ch
Mon May 19 15:25:30 GMT 2008


Hi,

I ran into a strange printing-problem:

We're using OpenBSD 4.2 and Samba Version 3.0.28
and include our printers directly from /etc/printcap;
whenever I enter a printername that contains numbers, smbd
gives me the errors below. Any idea why samba messes up with digits in 
printernames?


--------------------------------------------------------------------------------
/var/log/log.smbd (with smbd started in debuglevel 10)
--------------------------------------------------------------------------------

[2008/05/19 17:07:59, 3] 
/usr/ports/net/samba/w-samba-3.0.28/samba-3.0.28/source/printing/pcap.c:pcap_cache_reload(117)
   reloading printcap cache
[2008/05/19 17:07:59, 3] 
/usr/ports/net/samba/w-samba-3.0.28/samba-3.0.28/source/printing/pcap.c:pcap_cache_reload(223)
   reload status: ok
[2008/05/19 17:07:59, 7] 
/usr/ports/net/samba/w-samba-3.0.28/samba-3.0.28/source/param/loadparm.c:lp_servicenumber(5200)
   lp_servicenumber: couldn't find mfgZO01
[2008/05/19 17:07:59, 8] 
/usr/ports/net/samba/w-samba-3.0.28/samba-3.0.28/source/param/loadparm.c:add_a_service(2574)
   add_a_service: Creating snum = 12 for mfgZO01
[2008/05/19 17:07:59, 10] 
/usr/ports/net/samba/w-samba-3.0.28/samba-3.0.28/source/param/loadparm.c:hash_a_service(2621)
   hash_a_service: hashing index 12 for service name mfgZO01
[2008/05/19 17:07:59, 3] 
/usr/ports/net/samba/w-samba-3.0.28/samba-3.0.28/source/param/loadparm.c:lp_add_printer(2746)
   adding printer service mfgZO01
[2008/05/19 17:07:59, 7] 
/usr/ports/net/samba/w-samba-3.0.28/samba-3.0.28/source/param/loadparm.c:lp_servicenumber(5200)
   lp_servicenumber: couldn't find prnZO01
[2008/05/19 17:07:59, 8] 
/usr/ports/net/samba/w-samba-3.0.28/samba-3.0.28/source/param/loadparm.c:add_a_service(2574)
   add_a_service: Creating snum = 13 for prnZO01
[2008/05/19 17:07:59, 10] 
/usr/ports/net/samba/w-samba-3.0.28/samba-3.0.28/source/param/loadparm.c:hash_a_service(2621)
   hash_a_service: hashing index 13 for service name prnZO01
[2008/05/19 17:07:59, 3] 
/usr/ports/net/samba/w-samba-3.0.28/samba-3.0.28/source/param/loadparm.c:lp_add_printer(2746)
   adding printer service prnZO01
------------------------------------------------------------------------------



------------------------------------------------------------------------------
using the following /etc/printcap file (ip removed for privacy reasons):
------------------------------------------------------------------------------

#       $OpenBSD: printcap,v 1.4 2003/03/28 21:32:30 jmc Exp $

#lp|local line printer:\
#       :lp=/dev/lp:sd=/var/spool/output:lf=/var/log/lpd-errs:

#rp|remote line printer:\
#     :lp=:rm=printhost:rp=lp:sd=/var/spool/output:lf=/var/log/lpd-errs:

prnZO01|prnZO01:\
 
:lp=:rm=(printerIp1):rp=lp:sd=/var/spool/printer/prnZO01:sh:lf=/var/log/lpd-errs:

mfgZO01|mfgZO01:\
 
:lp=:rm=(printerIp2):rp=lp:sd=/var/spool/printer/mfgZO01:sh:lf=/var/log/lpd-errs:


--------------------------------------------------------------------------------





If i change the printcap file into the following, i dont get the problem 
any more:

---------------------------------------------------------------------------

#       $OpenBSD: printcap,v 1.4 2003/03/28 21:32:30 jmc Exp $

#lp|local line printer:\
#       :lp=/dev/lp:sd=/var/spool/output:lf=/var/log/lpd-errs:

#rp|remote line printer:\
#     :lp=:rm=printhost:rp=lp:sd=/var/spool/output:lf=/var/log/lpd-errs:

prnZO|prnZO:\
 
:lp=:rm=(printerIp1):rp=lp:sd=/var/spool/printer/prnZO01:sh:lf=/var/log/lpd-errs:

mfgZO|mfgZO:\
 
:lp=:rm=(printerIp2):rp=lp:sd=/var/spool/printer/mfgZO01:sh:lf=/var/log/lpd-errs:

----------------------------------------------------------------------------------


Heres our smb.conf:
----------------------------------------------------------------------------------

[global]
         workgroup = ###########
         netbios name = ###############
         server string = Samba Server
         security = domain
         log file = /var/log/samba/smbd.%m
         ;log level = 5
         max log size = 50
         ;passdb backend = tdbsam
         socket options = TCP_NODELAY
         interfaces = #############
         wins support = no
         wins server = #############
         os level = 65

         map system = yes
         map archive = yes
         map hidden = yes
         create mask = 0771
         directory mask = 0771

         csc policy = disable
         enable privileges = Yes

         printing = bsd
         load printers = yes
         show add printer wizard = yes
         printcap name = /etc/printcap
#       printer admin = @domadmins
         printcap cache time = 15
         lpq cache time = 30
         default devmode = yes

[printers]
         comment = SMB Print Spool
         path = /var/spool/samba/spool
         browseable = No
         guest ok = Yes
         public = Yes
         writable = No
         printable = Yes

[print$]
         default devmode = yes
         comment = Printer Drivers
         path = /usr/local/share/printer_drivers
         browsable = yes
         guest ok = yes
         read only = yes
         create mask = 0775
         directory mask = 0775
         write list = @domadmins

...
----------------------------------------------------------------------------------




More information about the samba mailing list