How do I force Samba to update shared printer list? (2.2.6-pre2)

Kurt Pfeifle kpfeifle at danka.de
Tue Sep 10 09:26:00 GMT 2002


Hi,

I have a question regarding the visible list of printers in the network
neighbourhood of my Samba server, and how to force it to become updated.
Maybe one of my settings is wrong? Maybe it is a bug?

My problem (short):
-------------------
Adding a new printer in CUPS creats printcap entry within seconds.
But becomes not visible in network neighbourhood without re-start of
smbd.

System info:
------------
* SuSE 7.3
* Samba 2.2.6-pre2 (compiled from recent CVS sources, after the "big
                     print patch"; dunno if my version-# is right though)
* CUPS 1.1.15


some relevant settings in cupsd.conf:
-------------------------------------

Printcap /etc/printcap         # this directive lets CUPS generate a
                                # dummy printcap

Browsing On                    # this directive lets CUPS listen for
                                # printer announcments by other CUPS servers

BrowseAddress 10.160.51.255    # this directive lets CUPS announce its own
                                # locally installed printers to the LAN

BrowseAllow All                # this directive asks CUPS to show *all*
                                # printer announcements unfiltered

BrowseShortNames No            # this directive asks CUPS to show printers on
                                # CUPS servers in a "printer at server" style


my settings in smb.conf:
------------------------
kde4 at kde-bitshop:/etc/samba/ >  cat smb.conf |grep -v "^$"|grep -v "^;" |grep -v "^#"
[global]
         workgroup = CUPS-Print
         show add printer wizard = yes
         encrypt passwords = Yes
         map to guest = Bad User
         time server = Yes
         unix extensions = Yes
         socket options = SO_KEEPALIVE IPTOS_LOWDELAY TCP_NODELAY
         printcap name = cups
         printing = cups
         character set = ISO8859-15
         os level = 2
         veto files = /*.eml/*.nws/riched20.dll/*.{*}/
         guest account = Nobody
         log level = 3
         load printers = Yes

         wins support = No
         client code page = 850
[homes]
         comment = Home Directories
         valid users = %S
         read only = No
         create mask = 0640
         directory mask = 0750
         browseable = No
[printers]
         comment = All Printers
         path = /var/spool/samba
         create mask = 0600
         printable = Yes
         browseable = Yes
         public = yes
         guest ok = yes
         writable = no
         printer admin = root
[print$]
         comment = Printer Drivers
         path = /etc/samba/drivers
         write list = root,Danka,kde4,kurt
         browseable = Yes
         guest ok = Yes
         read only = yes


My problem (long description):
------------------------------
After adding a new printer in CUPS, it appears within seconds in
"/etc/printcap", but it is not visible in the network neighbourhood (even
after waiting one hour). (Client is a Windows XP Professional)

* It is visible within seconds to other CUPS boxen via the "CUPS browsing"
   mechanism.

* It does not even appear on a client's radar when executing "F5" (Update View)
   [my translation; I have a German version of WinXP running], even after the
   client seems to chew quite a few seconds on the command, with the printer list
   dissappearing for the same timespan, and  while "tail -f log.smbd" seems to
   indicate that Samba is processing the update request.

* It is also not visible through the "rpcclient" command:
   "rpcclient localhost -N -U'root%root' -c 'enumprinters'" too shows the old
   list...

* BTW, the "cupsaddsmb -v" command also fails for that printer:
   --> it says "Printer Driver... successfully installed" (for WIN40 and W32X86),
       but...
   --> it says "cmd = setdriver... result was NT_STATUS_UNSUCCESSFUL"

* The missing update of the view also concerns the deletion of printers. If I
   use "lpadmin -x printer_name" to delete a printer, this one dissappears from
   the printcap the next second, but is visible in the network neighbourhood for
   ages (even through re-boots of the Win client(s)), until a re-start of smbd.

* When watching the log.smbd while updating the view of a client onto the Samba
   server's printer folder, one can find error messages appearing that say this
   (debuglevel 5, grepping for "2027"):

     turbo_xp (10.160.51.70) couldn't find service is2027
     checking for home directory is2027 gave (NULL)
     checking whether is2027 is a valid printer name...
     cups_printername_ok("is2027")
     Unable to get printer status for is2027 - client-error-not-found
     is2027 is not a valid printer name
     find_service() failed to find service is2027
     turbo_xp (10.160.51.70) couldn't find service is2027

   Now, this phantom printer "is2027" was deleted by me several weeks ago on the
   CUPS/Samba server. It is also not visible for the WinXP client (being
   "turbo_xp" with IP 10.160.51.70) in the network neighbokurhood. (However,
   there are still traces of "is2027" in the registry of turbo_xp). --  Still,
   every update request for the (is2027-lacking) view on the Samba printer
   folder from a client generates new entries like the above one in the log
   file...

* Only a complete re-start of Samba forces the immediate visibility of the new
   printer in the network neighbourhood as well as through "rpcclient
   enumprinters".

* After the re-start of Samba, "cupsaddsmb" is able to prepare the driver for
   download to the clients:
   --> it says "Printer Driver... successfully installed" (for WIN40 and W32X86),
       but...
   --> it says "cmd = setdriver... Succesfully set... to driver ...."

   After that, clients can install the driver just fine and, of course, printing
   also works....   ;-)  [BTW, "cupsaddsmb" is even capable to install drivers
   which are not *locally* installed, but on a remote CUPS server! For details
   and a more detailed transcript of a commandline session, please see the files
   on http://www.linuxprinting.org/kpfeifle/tmp/ . I've also placed my working,
   selfcompiled SuSE-7.3 samba-2.2.6-pre2 RPM package and the "cupsaddsmb"
   binary there...

Someone knowing more about the "updating-view-not-working-without-smbd-restart"
than me?

Thanks & Cheers,
Kurt


##########################################
------------------------------------------
attachment of example session transscript:
------------------------------------------
##########################################

#-----------------------------------#
#-- installing additional printer --#
#-----------------------------------#
kde-bitshop:~ # lpadmin -p printer_visible_only_after_restart_of_smbd \
                         -v socket://10.160.51.131:9100 \
                         -E \
                         -P /etc/cups/ppd/mopi.ppd

#-----------------------------------#
#----   examining the printcap  ----#
#-----------------------------------#
kde-bitshop:~ # cat /etc/printcap
# This file was automatically generated by cupsd(8) from the
# /etc/cups/printers.conf file.  All changes to this file
# will be lost.
DigiMaster:
designj:
DeskJet990 at 10.160.51.2:       # this printer is installed on a remote CUPS server
foomatic:
hp8550 at 10.160.51.2:           # second printer on remote CUPS server
HPOfficeHetD155:
ir8500:
mopi:
mopi2:
pdfgoffioul:
peerkoch:
printer_visible_only_after_restart_of_smbd:  # this printer not visible in rpcclient or network neighbourhood
ryan:
test2devnull:
testdeskjetppd:
testprinter:

#------------------------------------------------#
#-- does 'rpcclient' list the new printer? No! --#
#------------------------------------------------#
kde4 at kde-bitshop:~> rpcclient localhost -N -U'root%root' -c 'enumprinters'  # some outputlines deleted
cmd = enumprinters
         name:[\\localhost\a]                   # this printer had been deleted and doesn't
                                                # appear in printcap any more...
         name:[\\localhost\designj]

         name:[\\localhost\DeskJet990 at 10.160.51.2]  # this printer's driver is served well by "cupsaddsm"

         name:[\\localhost\DigiMaster]

         name:[\\localhost\foomatic]

         name:[\\localhost\hp8550 at 10.160.51.2]      # cupsaddsmb works here too....

         name:[\\localhost\HPOfficeHetD155]

         name:[\\localhost\ir8500]

         name:[\\localhost\mopi]

         name:[\\localhost\mopi2]

         name:[\\localhost\pdfgoffioul]

         name:[\\localhost\peerkoch]

         name:[\\localhost\ryan]

         name:[\\localhost\test2devnull]

         name:[\\localhost\testdeskjetppd]

         name:[\\localhost\testprinter]

#-----------------------------------#
#--- does 'cupsaddsmb' work? No! ---#
#-----------------------------------#
kde-bitshop:/home/kde4 # cupsaddsmb -v printer_visible_only_after_restart_of_smbd
[....]
running command: rpcclient localhost -N -U'root%root' -c 'adddriver "Windows NT x86" [....]:RAW:NULL"'
cmd = adddriver "Windows NT x86" "printer_visible_only_after_restart_of_smbd:[....]:RAW:NULL"
Printer Driver printer_visible_only_after_restart_of_smbd successfully installed.

Running command: rpcclient localhost -N -U'root%root' -c 'adddriver "Windows 4.0" [....]DEFPRTR2.PPD,ICONLIB.DLL"'
cmd = adddriver "Windows 4.0" "printer_visible_only_after_restart_of_smbd:[....] DEFPRTR2.PPD,ICONLIB.DLL"
Printer Driver printer_visible_only_after_restart_of_smbd successfully installed.

Running command: rpcclient localhost -N -U'root%root' -c 'setdriver
                  printer_visible_only_after_restart_of_smbd printer_visible_only_after_restart_of_smbd'
cmd = setdriver printer_visible_only_after_restart_of_smbd printer_visible_only_after_restart_of_smbd
result was NT_STATUS_UNSUCCESSFUL

#------------------------------------------------------------------------------------------#
#- can Win clients download driver for "printer_visible_only_after_restart_of_smbd"?  NO! -#
#------------------------------------------------------------------------------------------#
This is to be expected, after 'cupsaddsmb' failed so obviously....


#---------------------------#
#---- stopping samba... ----#
#---------------------------#
kde-bitshop:~> su
Password:

kde-bitshop:/home/kde4 # ps aux |grep mbd
root  30131  0.0  0.1  4372  920 ?      S  Sep09  0:01 /usr/sbin/nmbd -D -s /etc/samba/smb.conf
root  30133  0.0  0.1  5760  784 ?      S  Sep09  0:00 /usr/sbin/smbd -D -s /etc/samba/smb.conf
root  30135  0.0  0.7  7280 3760 ?      S  Sep09  0:26 /usr/sbin/smbd -D -s /etc/samba/smb.conf
root  24448  0.0  0.1  1764  688 pts/14 S  08:56  0:00 grep mbd

kde-bitshop:/home/kde4 # kill 30131 30133 30135

#-----------------------------#
#---- restarting samba... ----#
#-----------------------------#
kde-bitshop:/home/kde4 # /usr/sbin/nmbd -D -s /etc/samba/smb.conf

kde-bitshop:/home/kde4 # /usr/sbin/smbd -D -s /etc/samba/smb.conf

kde-bitshop:/home/kde4 # exit
exit

#-----------------------------------------------------#
#-- does 'rpcclient' now list the new printer? YES! --#
#-----------------------------------------------------#
kde4 at kde-bitshop:~> rpcclient localhost -N -U'root%root' -c 'enumprinters'    # some outputlines deleted
cmd = enumprinters
         name:[\\localhost\designj]

         name:[\\localhost\DeskJet990 at 10.160.51.2]

         name:[\\localhost\DigiMaster]

         name:[\\localhost\foomatic]

         name:[\\localhost\hp8550 at 10.160.51.2]

         name:[\\localhost\HPOfficeHetD155]

         name:[\\localhost\ir8500]

         name:[\\localhost\mopi]

         name:[\\localhost\mopi2]

         name:[\\localhost\pdfgoffioul]

         name:[\\localhost\peerkoch]

         name:[\\localhost\printer_visible_only_after_restart_of_smbd]   # I told you so!

         name:[\\localhost\ryan]

         name:[\\localhost\test2devnull]

         name:[\\localhost\testdeskjetppd]

         name:[\\localhost\testprinter]


#--------------------------------------------#
#--- does 'cupsaddsmb' work *now* ? YES!! ---#
#--------------------------------------------#
kde-bitshop:/home/kde4 # cupsaddsmb -v printer_visible_only_after_restart_of_smbd
[....]
running command: rpcclient localhost -N -U'root%root' -c 'adddriver "Windows NT x86" [....]:RAW:NULL"'
cmd = adddriver "Windows NT x86" "printer_visible_only_after_restart_of_smbd:[....]:RAW:NULL"
Printer Driver printer_visible_only_after_restart_of_smbd successfully installed.

Running command: rpcclient localhost -N -U'root%root' -c 'adddriver "Windows 4.0" [....]DEFPRTR2.PPD,ICONLIB.DLL"'
cmd = adddriver "Windows 4.0" "printer_visible_only_after_restart_of_smbd:[....] DEFPRTR2.PPD,ICONLIB.DLL"
Printer Driver printer_visible_only_after_restart_of_smbd successfully installed.

Running command: rpcclient localhost -N -U'root%root' -c 'setdriver
                  printer_visible_only_after_restart_of_smbd printer_visible_only_after_restart_of_smbd'
cmd = setdriver printer_visible_only_after_restart_of_smbd printer_visible_only_after_restart_of_smbd
Succesfully set printer_visible_only_after_restart_of_smbd to driver printer_visible_only_after_restart_of_smbd.


#---------------------------------------------------------------------------------------#
#- can clients *now* download driver for "printer_visible_only_after_restart_of_smbd"  -#
#-                                               and print to it? YES!                 -#
#---------------------------------------------------------------------------------------#




More information about the samba-technical mailing list