Partially answered--Real-world use of backend error handler?

Michael embedded at verizon.net
Sun Aug 20 18:01:42 PDT 2006


> Now I got to the point in the CUPS Quickstart that talks about the backend error handler (beh).  I want to use this command:
> lpadmin -p HP5L -E -v beh:/0/0/8/parallel:/dev/lp0
>
> My main question is where the lpadmin command should be invoked from.  > I am tempted to put it under /etc/init.d/cupsys so that is invoked
> whenever the CUPS server is started or restarted.  Is this the standard > thing to do?

Well I tried this approach and it didn't work.  This was what the restart section of my cupsys file looked like:

restart|force-reload)
  echo -n "Restarting $DESC: $NAME"
  if start-stop-daemon --stop --quiet --retry TERM/10 --oknodo --exec $DAEMON; then start-stop-daemon --start --quiet --background -m --pidfile  /var/run/cups/cupsd.pid --exec $DAEMON -- -F
  fi
  echo "."
lpadmin -p hp5l -E -v beh:/0/0/8/parallel:/dev/lp0
  ;;

However, when I did this:
sudo /etc/init.d/cupsys restart
I got this:
Restarting Common Unix Printing System: cupsd.
lpadmin: Unable to connect to server: Connection refused

I'm thinking maybe the connection is refused because the server "needs time" to go back up, but I'm not sure.  At any rate, when I tried executing the lpadmin command manually in a bash shell, it worked without complaint.  After that "lpstat -v" shows that the change stuck, even after a reboot.

Would still appreciate any explanation of what's going on here, plus any answers to the 3 "minor questions" in my original post.  Thanks!





More information about the cups mailing list