270.3. cups-browsed-2.1.1
Daemon that turns printers announced on the network into local CUPS queues
2.1.1-1 · Apache-2.0 WITH LLVM-exception · 0.1 SBU · 660.5 KiB, 19 files · 43_toolkits, 254 of 344 · ports/core/printing/cups-browsed
Homepage: https://github.com/OpenPrinting/cups-browsed
Why it is in KDOS. The comment above the 4 ports from libcupsfilters to cups-browsed in script/phases/43_toolkits/packages.d/printing.txt:
Without filters cups accepts a job, spools it, runs the paper through and prints nothing on it. The queue existing is not the same as the page coming out right.
cups-browsed watches the network for printers announced over DNS-SD by avahi and turns each one it finds into a local CUPS queue, driverless through libcupsfilters and libppd, so a network printer is there to print to with nothing added by hand. /etc/init.d/81_cups-browsed.sh runs it under supervision after 80_cups.sh; it never forks, so it needs no foreground flag.
Depends on: cups, libcupsfilters, libppd, avahi, glib, pkgconf.
Required by (1): cups-filters.
Sources: cups-browsed-2.1.1.tar.xz (410.1 KiB). Every step kpkg takes applies to this port.
Install: script/chroot/exec.sh bash -c 'source script/phases/43_toolkits/phase.env && kpkg install cups-browsed'
build.sh:
export LDFLAGS="$LDFLAGS -Wl,-z,stack-size=8388608"
./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib \
--localstatedir=/var --disable-static \
--enable-avahi --with-rcdir=no --disable-nls \
--with-cups-rundir=/run/cups \
--with-cups-domainsocket=/run/cups/cups.sock
make
make DESTDIR=$PKG install
-Wl,-z,stack-size=8388608, added toLDFLAGS— ask for an 8 MiB stack in the program’sPT_GNU_STACKheader, the size a thread gets by default on glibc, where upstream develops. musl gives each new thread 128 KiB unless that header asks for more, and cups-browsed starts the threads that resolve a printer and create its queue (resolve_callback,create_queue) with default attributes. The queue-creation thread overruns 128 KiB inside libcupsfilters: as soon as an IPP printer is announced the daemon dies with SIGSEGV at a fault address equal to its stack pointer, the supervisor restarts it, and it dies again every few seconds, so no queue is ever added.readelf -lW /usr/sbin/cups-browsedshows the size as theGNU_STACKentry’s0x800000.--enable-avahi— Browse for printers through Avahi’s client library.--with-rcdir=no— Install no System V init script; the init script is KDOS’s own.--with-cups-rundir=/run/cupsand--with-cups-domainsocket=/run/cups/cups.sock— Reach the scheduler on the socket the cups port’scupsdlistens on.
Programs: cups-browsed.
Directories: /usr/share/doc/cups-browsed, /usr/share/licenses/cups-browsed.
cups-browsed adds queues to cupsd and does nothing without it, so it runs only while cupsd does. 80_cups.sh starts it once cupsd is supervised, unless /etc/service.disabled/cups-browsed exists, and stops it before cupsd; sudo service start cups brings both up. Started on its own while cupsd is not supervised, the init script prints [SKIP] cups-browsed: CUPS is off and starts nothing.