Sunday, September 13, 2009

Modifying Print Queue Behavior

Somewhere after 10.5.4 Apple modified the way in which print queues can be controlled.  It requires you to either put users/groups into the lpadmin group, or you need to edit the /etc/cups/cupsd.conf file.  One of the things we need to do is allow a valid user to operate a print queue (pause, resume, cancel jobs) but not modify or add/delete print queues.  You can edit a section of of the cupsd.conf file to achieve this..


1. Make a backup of your existing cupsd.conf file


sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.bak


2. Edit the follow section of the original using your favorite text editor of choice.


Edit the lines below that entry from:
   AuthType Default
   Require user @AUTHKEY(system.print.admin) @admin @lpadmin
   Order deny,allow


 To:
   #AuthType Default
   #Require user @AUTHKEY(system.print.admin) @admin @lpadmin
   Require valid-user
   Order deny,allow



3. Stop and restart the cups service (or reboot).


killall -HUP cupsd


Thats it.  You can then distribute that modified cupsd.conf file as you would any other file.  Make sure you use a postflight script to stop/restart the cups service, or your changes wont take affect until a restart.