Red Hat Bugzilla – Bug 246029
Printer operation policy not set on service start / restart / reload
Last modified: 2007-11-30 17:12:08 EST
Description of problem:
When the CUPS service is started or restarted or reloaded printer operation
policies are not set (they are left 'default').
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. service cups restart / start / reload
2. lpadmin -p myprinter -o printer-op-policy=foo
3. Policy takes affect.
4. service cups restart / start / reload
5. Policy for myprinter was reset to 'default'
Unlike the report in CUPS STR #2319 a reload does *not* preserve or loads
printer operation policies.
This script, placed in /etc/init.d/cups, can workaround this.
while read tag printer; do
[[ "$tag" != "<Printer" ]] && continue
while read tag value; do
[[ "$tag" == "</Printer>" ]] && break
[[ "$tag" != "OpPolicy" ]] && continue
echo "lpadmin -p $printer -o printer-op-policy=$value"
lpadmin -p $printer -o printer-op-policy=$value
done < /etc/cups/printers.conf
*** This bug has been marked as a duplicate of 246027 ***