# cups - CUPS Printing spooler and server description "CUPS printing spooler/server" author "Michael Sweet " start on (filesystem and (started dbus or runlevel [2345]) and stopped udevtrigger) stop on runlevel [016] respawn pre-start script set -x exec 2>/tmp/cups.log [ -x /usr/sbin/cupsd ] # load modules for parallel port support if [ -r /etc/default/cups ]; then . /etc/default/cups fi if [ "$LOAD_LP_MODULE" = "yes" -a -f /usr/lib/cups/backend/parallel \ -a -f /proc/modules -a -x /sbin/modprobe ]; then modprobe -q -b lp || true modprobe -q -b ppdev || true modprobe -q -b parport_pc || true fi mkdir -p /var/run/cups/certs if [ -x /lib/init/apparmor-profile-load ]; then /lib/init/apparmor-profile-load usr.sbin.cupsd fi end script exec /usr/sbin/cupsd -F post-start script set -x exec 2>>/tmp/cups.log # wait until daemon is ready timeout=10 while [ ! -e /var/run/cups/cups.sock ]; do sleep 0.5 timeout=$((timeout-1)) if [ "$timeout" -eq 0 ]; then echo "cupsd failed to create /var/run/cups/cups.sock, skipping automatic printer configuration" >&2 exit 0 fi done # coldplug USB printers if ! /lib/udev/udev-configure-printer enumerate 2>/dev/null; then if type udevadm > /dev/null 2>&1 && [ -x /lib/udev/udev-configure-printer ]; then for printer in `udevadm trigger --verbose --dry-run --subsystem-match=usb \ --attr-match=bInterfaceClass=07 --attr-match=bInterfaceSubClass=01 2>/dev/null || true; \ udevadm trigger --verbose --dry-run --subsystem-match=usb \ --sysname-match='lp[0-9]*' 2>/dev/null || true`; do /lib/udev/udev-configure-printer add "${printer#/sys}" done fi fi end script