high availability

screwgie at gmail.com screwgie at gmail.com
Wed Sep 21 13:23:34 PDT 2005


> Hi,
>
> We have installed CUPS on 2 servers. The CUPS clients are configured to work with these 2 CUPS servers If we define a printer on both systems in exactly the same way, the " implicit classes" function of cups will recognize this as one printer. So we reached our goal of High availability.
>
> To easy the administration effort, i was thinking to use rsync to sync the contents of the printers.conf file on both machines. Has anyone done this?
> As i need to restart cups to make the changes visible, i was wondering what effect this will have on printjobs that are currently being printed. Or is there an other way of having cups reread the printers.conf file?
>

I am currently doing this. I have a cron job on the "secondary" server that copies over the printers.conf file to a temporary file using rsync. Keeping timestamps intact. Then it compares the current printers.conf file to the one it just copied. If the timestamp is newer, meaning it's been updated more recently, it then moves this temporary file in /etc/cups and restarts the cups server.

Any jobs that are in the queue during the restart are not lost.

Here is the script:
==============================================================
#!/bin/sh

if [  /etc/cups/printers.conf -ot /home/cupssync/cups/printers.conf.rsync ]; then
        cp /etc/cups/printers.conf /etc/cups/printers.conf.old
        echo "Backup of original printers.conf file made."
        mv /home/cupssync/cups/printers.conf.rsync /etc/cups/printers.conf
        /etc/init.d/cups restart
else echo "No change in printers.conf file."
fi
==============================================================




More information about the cups mailing list