I have samba configured to serve up all the printers configured in cups. This works fine if samba is started (or restarted) manually. However, when started on boot, although samba is started after cups (the samba init script says "use cupsd"), it does not serve any printers. As a work-around, I changed the samba init script to say "after *" to get it to start a bit later than "use cupsd" does. This gives cups more time to complete its startup. By the time samba starts, it manages to enumerate the printers correctly and serves them all. My work-around is in the wrong place really. It would be better if the cupsd init script didn't return until the server is fully initialised and ready to list the printers. Reproducible: Always Steps to Reproduce: 1. Configure samba to use cups to find printers. 2. Add samba and cupsd to the default run level. 3. Reboot. 4. Do "smbclient -L localhost -N" Actual Results: No printers appear in the smbclient output. Expected Results: The output from smbclient should include a line for each printer, like this: Sharename Type Comment --------- ---- ------- IPC$ IPC IPC Service (Samba Server 2.2.7a) ADMIN$ Disk IPC Service (Samba Server 2.2.7a) dj895cxi Printer Manually do '/etc/init.d/samba restart'. Smbclient will then show the printers correctly. net-fs/samba: 2.2.7a net-print/cups: 1.1.18 Portage 2.0.46-r6 (default-1.0, gcc-2.95.3, glibc-2.2.5-r7,2.2.5-r4) ================================================================= System uname: 2.4.19-gentoo-r10 i686 Pentium II (Deschutes) GENTOO_MIRRORS="http://www.ibiblio.org/pub/Linux/distributions/gentoo" CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/confi g /usr/kde/3/share/c onfig /usr/share/config:/usr/X11R6/lib/X11/xkb:/usr/kde/3/share/config" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" PORTDIR="/usr/portage" DISTDIR="/usr/portage/distfiles" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR_OVERLAY="" USE="x86 oss 3dnow apm avi crypt cups encode jpeg libg++ libwww mikmod mmx mpeg ncurses pdflib qtmt quicktime spell truetype xml2 xmms xv arts berkdb cdr esd gdbm gif gnome-libs gpm gtk imlib java kde motif nls oggvorbis opengl pam perl png python qt readline scanner sdl slang ssl svga tcpd tiff X" COMPILER="" CHOST="i686-pc-linux-gnu" CFLAGS="-march=i686 -O3 -pipe" CXXFLAGS="-march=i686 -O3 -pipe" ACCEPT_KEYWORDS="x86" MAKEOPTS="-j2" AUTOCLEAN="yes" SYNC="rsync://rsync.gentoo.org/gentoo-portage" FEATURES="sandbox ccache"
exactly the same bug for me !!!
here is my patch : --- /etc/init.d/cupsd 2003-01-31 18:16:18.000000000 +0100 +++ cupsd 2003-06-07 05:58:24.000000000 +0200 @@ -10,6 +10,17 @@ start() { ebegin "Starting cupsd" start-stop-daemon --start --quiet --background --exec /usr/sbin/cupsd + retry=5 + while [ ${retry} -gt 0 ] + do + lpstat > /dev/null 2>&1 + if [ $? -eq 0 ] + then + break 1 + fi + sleep 1 + retry=$((${retry} -1)) + done eend $? } It check with lpstat if cupsd has started ... maybe i have to return a fail if he dant start after number of retry, but it's too late in the morning : i really have to get some sleep ....
will have a look .. sorry for the delay there was a problem with the mail alias so i didn't get the Bugzilla mails
deleting the --background from start-stop-daemon should do the trick
Hi (from original bug reporter), Sorry for not trying your suggestions earlier. I removed the --background from the init script and the problem was solved. Boot time increased a bit, but hey, that was what was neccesary, right? Commit the change I say. Thanks a lot for your help, Chris.
fixed.