[Samba] printer woes

Jay G. Scott
Wed, 13 Jun 2007 16:05:00 -0000

greetings.

my problem is i can't print from windows 2000 or windows xp.
my solaris box can print fine.


on smoking (solaris 10, samba host)

smbclient '//smoking/hp2605' -U jgs%password put /etc/motd
i get the printout.


on windows, this works:

echo hiya^L > \\smoking\hp2605

on windows, from M$ word, the print SEEMS to go into the queue.
i click on the printer, get the box that supposedly shows me status,
and it says the file is getting spooled.  but nothing emerges.
the printer never seems to get any bytes at all--but i can't prove it.

you can see from the log file (log.smbd) that it's complaining about
a printer handle.

i've included testparm, two diff smb.conf's, and two diff smbd logs.
i tried searching for the business about the printer handle not
being found but i didn't see any solutions--just questions.
somebody, somewhere, said that if you duplicated the printer
in cups and changed the name, that that would work around it.
i don't know exactly what that means.

ahh, yes--
ping works all around.
nslookup works all around.
the windows boxes can mount the samba directory shares.
can't think of anything else to tell you.

thx.

j.
--------------------------------------------------------------------------------

Script started on Tue Jun 12 23:53:58 2007
smoking# testparm
Load smb config files from /etc/sfw/smb.conf
Processing section "[small]"
Processing section "[note]"
Processing section "[www]"
Processing section "[backups]"
Processing section "[hp2605]"
Loaded services file OK.
WARNING: passdb expand explicit = yes is deprecated
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
	workgroup = CRATER
	log level = 2
	printcap name = lpstat

[small]
	comment = small on smoking
	path = /VOLUMES/small
	valid users = root, jgs
	read only = No
	create mask = 0750

[note]
	comment = note on smoking
	path = /VOLUMES/note
	valid users = root, jgs
	read only = No
	create mask = 0750

[www]
	comment = www on smoking
	path = /VOLUMES/www
	valid users = root, jgs
	read only = No
	create mask = 0750

[backups]
	comment = backups on smoking
	path = /VOLUMES/backups
	valid users = root, jgs
	read only = No
	create mask = 0750

[hp2605]
	comment = All Printers
	path = /var/spool/samba
	read only = No
	guest ok = Yes
	printable = Yes
	use client driver = Yes



smoking# more /etc/x[Ksfw/smb.conf
[global]
	guest account = nobody

;  You will need a world readable lock directory and "share modes=yes"
;  if you want to support the file sharing modes for multiple users
;  of the same files

	lock directory = /var/samba/locks
	share modes = yes

	workgroup = CRATER

	netbios name = smoking
	browseable = yes

##	debug level = 3
	debug level = 2


# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
	load printers = yes

# you may wish to override the location of the printcap file
;   printcap name = /etc/printcap

# on SystemV system setting printcap name to lpstat should allow
# you to automatically obtain a printer list from the SystemV spool
# system
	printcap name = lpstat

# It should not be necessary to specify the print system type unless
# it is non-standard. Currently supported print systems include:
# bsd, cups, sysv, plp, lprng, aix, hpux, qnx
###	printing = cups
	printing = sysv
###	printing = bsd


[small]
	comment = small on smoking
	browseable = yes
	valid users = root jgs
	writeable = yes
	public = no
	create mode = 0750
	path = /VOLUMES/small


[note]
	comment = note on smoking
	browseable = yes
	valid users = root jgs
	writeable = yes
	public = no
	create mode = 0750
--More--(63%)[K	path = /VOLUMES/note

;;;	may not need this.  never have, anyway.
[www]
	comment = www on smoking
	browseable = yes
	valid users = root jgs
	writeable = yes
	public = no
	create mode = 0750
	path = /VOLUMES/www

[backups]
	comment = backups on smoking
	browseable = yes
	valid users = root jgs
	writeable = yes
	public = no
	create mode = 0750
	path = /VOLUMES/backups


# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer
###[printers]
[hp2605]
	comment = All Printers
	path = /var/spool/samba
	browseable = yes
	use client driver = yes
# Set public = yes to allow user 'guest account' to print
	public = yes
	guest ok = yes
	writable = yes
	printable = yes
#
###	print command = /usr/bin/lp %s


smoking# more smbd
[2007/06/12 23:54:47, 0] smbd/server.c:(805)
  smbd version 3.0.21b started.
  Copyright Andrew Tridgell and the Samba Team 1992-2006
[2007/06/12 23:54:47, 2] param/loadparm.c:(3675)
  Processing section "[small]"
[2007/06/12 23:54:47, 2] param/loadparm.c:(3675)
  Processing section "[note]"
[2007/06/12 23:54:47, 2] param/loadparm.c:(3675)
  Processing section "[www]"
[2007/06/12 23:54:47, 2] param/loadparm.c:(3675)
  Processing section "[backups]"
[2007/06/12 23:54:47, 2] param/loadparm.c:(3675)
  Processing section "[hp2605]"
[2007/06/12 23:54:48, 2] lib/interface.c:(81)
  added interface ip=10.1.1.4 bcast=10.1.255.255 nmask=255.255.0.0
[2007/06/12 23:54:48, 2] lib/tallocmsg.c:(61)
  Registered MSG_REQ_POOL_USAGE
[2007/06/12 23:54:48, 2] lib/dmallocmsg.c:(71)
  Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
[2007/06/12 23:54:48, 2] smbd/server.c:(336)
  waiting for a connection
[2007/06/12 23:54:49, 2] smbd/sesssetup.c:(772)
  setup_new_vc_session: New VC == 0, if NT4.x compatible we would close all old
resources.
[2007/06/12 23:54:49, 2] smbd/sesssetup.c:(772)
  setup_new_vc_session: New VC == 0, if NT4.x compatible we would close all old
resources.
[2007/06/12 23:54:49, 2] auth/auth.c:(307)
  check_ntlm_password:  authentication for user [jgs] -> [jgs] -> [jgs]
succeede
d
[2007/06/12 23:54:49, 2] rpc_server/srv_spoolss_nt.c:(271)
  find_printer_index_by_hnd: Printer handle not found: find_printer_index_by_hnd
: Printer handle not found: get_printer_snum: Invalid handle (OTHER:1670:1812)
[2007/06/12 23:54:49, 2] rpc_server/srv_spoolss_nt.c:(271)
  find_printer_index_by_hnd: Printer handle not found: find_printer_index_by_hnd
: Printer handle not found: close_printer_handle: Invalid handle (OTHER:1670:181
2)
[2007/06/12 23:54:54, 2] rpc_server/srv_spoolss_nt.c:(271)
  find_printer_index_by_hnd: Printer handle not found: get_printer_snum: Invalid
 handle (OTHER:1670:1812)
[2007/06/12 23:54:54, 2] rpc_server/srv_spoolss_nt.c:(271)
  find_printer_index_by_hnd: Printer handle not found: find_printer_index_by_hnd
: Printer handle not found: close_printer_handle: Invalid handle (OTHER:1670:181
2)
smoking# ^Dexit

script done on Tue Jun 12 23:57:13 2007
--------------------------------------------------------------------------------

Script started on Tue Jun 12 23:57:52 2007
smoking# more smb.con[K[K[K[K[K[K[K/etc/f[Ksfw/smb.conf
[global]
	guest account = nobody

;  You will need a world readable lock directory and "share modes=yes"
;  if you want to support the file sharing modes for multiple users
;  of the same files

	lock directory = /var/samba/locks
	share modes = yes

	workgroup = CRATER

	netbios name = smoking
	browseable = yes

##	debug level = 3
	debug level = 2


# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
	load printers = yes

# you may wish to override the location of the printcap file
;   printcap name = /etc/printcap

# on SystemV system setting printcap name to lpstat should allow
# you to automatically obtain a printer list from the SystemV spool
# system
	printcap name = lpstat

# It should not be necessary to specify the print system type unless
# it is non-standard. Currently supported print systems include:
# bsd, cups, sysv, plp, lprng, aix, hpux, qnx
###	printing = cups
###	printing = sysv
###jjj
###	printing = bsd


[small]
	comment = small on smoking
	browseable = yes
	valid users = root jgs
	writeable = yes
	public = no
	create mode = 0750
	path = /VOLUMES/small


[note]
	comment = note on smoking
	browseable = yes
	valid users = root jgs
	writeable = yes
	public = no
	create mode = 0750
--More--(63%)[K	path = /VOLUMES/note

;;;	may not need this.  never have, anyway.
[www]
	comment = www on smoking
	browseable = yes
	valid users = root jgs
	writeable = yes
	public = no
	create mode = 0750
	path = /VOLUMES/www

[backups]
	comment = backups on smoking
	browseable = yes
	valid users = root jgs
	writeable = yes
	public = no
	create mode = 0750
	path = /VOLUMES/backups


# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer
###[printers]
[hp2605]
	comment = All Printers
	path = /var/spool/samba
	browseable = yes
	use client driver = yes
# Set public = yes to allow user 'guest account' to print
	public = yes
	guest ok = yes
	writable = yes
	printable = yes
#
###	print command = /usr/bin/lp %s



smoking# mor[K[K[Kmore /etc/sfw/smb.conf[17Dsmbd[K
[2007/06/12 23:58:00, 0] smbd/server.c:(805)
  smbd version 3.0.21b started.
  Copyright Andrew Tridgell and the Samba Team 1992-2006
[2007/06/12 23:58:00, 2] param/loadparm.c:(3675)
  Processing section "[small]"
[2007/06/12 23:58:00, 2] param/loadparm.c:(3675)
  Processing section "[note]"
[2007/06/12 23:58:00, 2] param/loadparm.c:(3675)
  Processing section "[www]"
[2007/06/12 23:58:00, 2] param/loadparm.c:(3675)
  Processing section "[backups]"
[2007/06/12 23:58:00, 2] param/loadparm.c:(3675)
  Processing section "[hp2605]"
[2007/06/12 23:58:00, 2] lib/interface.c:(81)
  added interface ip=10.1.1.4 bcast=10.1.255.255 nmask=255.255.0.0
[2007/06/12 23:58:00, 2] lib/tallocmsg.c:(61)
  Registered MSG_REQ_POOL_USAGE
[2007/06/12 23:58:00, 2] lib/dmallocmsg.c:(71)
  Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
[2007/06/12 23:58:00, 2] smbd/server.c:(336)
  waiting for a connection
[2007/06/12 23:58:03, 2] smbd/sesssetup.c:(772)
  setup_new_vc_session: New VC == 0, if NT4.x compatible we would close all old
resources.
[2007/06/12 23:58:03, 2] smbd/sesssetup.c:(772)
  setup_new_vc_session: New VC == 0, if NT4.x compatible we would close all old
resources.
[2007/06/12 23:58:03, 2] auth/auth.c:(307)
  check_ntlm_password:  authentication for user [jgs] -> [jgs] -> [jgs]
succeede
d
[2007/06/12 23:58:03, 2] rpc_server/srv_spoolss_nt.c:(271)
  find_printer_index_by_hnd: Printer handle not found: find_printer_index_by_hnd
: Printer handle not found: get_printer_snum: Invalid handle (OTHER:1812:1877)
[2007/06/12 23:58:03, 2] rpc_server/srv_spoolss_nt.c:(271)
  find_printer_index_by_hnd: Printer handle not found: find_printer_index_by_hnd
: Printer handle not found: close_printer_handle: Invalid handle (OTHER:1812:187
7)
[2007/06/12 23:58:04, 2] rpc_server/srv_spoolss_nt.c:(271)
  find_printer_index_by_hnd: Printer handle not found: get_printer_snum: Invalid
 handle (OTHER:1812:1877)
[2007/06/12 23:58:04, 2] rpc_server/srv_spoolss_nt.c:(271)
  find_printer_index_by_hnd: Printer handle not found: find_printer_index_by_hnd
: Printer handle not found: close_printer_handle: Invalid handle (OTHER:1812:187
7)
[2007/06/12 23:59:07, 2] rpc_server/srv_spoolss_nt.c:(271)
  find_printer_index_by_hnd: Printer handle not found: find_printer_index_by_hnd
: Printer handle not found: get_printer_snum: Invalid handle (OTHER:1812:1877)
[2007/06/12 23:59:07, 2] rpc_server/srv_spoolss_nt.c:(271)
  find_printer_index_by_hnd: Printer handle not found: find_printer_index_by_hnd
: Printer handle not found: close_printer_handle: Invalid handle (OTHER:1812:187
7)
smoking# ^Dexit

script done on Wed Jun 13 00:00:06 2007