printers.conf

angelb angelb at bugarin.us
Thu Apr 10 08:41:58 PDT 2008


> > Oskar Hajek wrote:
> > >> Oskar Hajek wrote:
> > >>> Hello,
> > >>> is it possible to reload the printers.conf w/o hanging up cupsd?
> > You could write a program that monitors the "master" server for config
> > changes and mirror them locally.
>
> but when i just mirror the printers.conf file, i need to reload/restart cupsd to get printer configuration changes recognized by the already running server?!

Oskar, Mike has already pointed out the proper way to do the sync. So,
I will not try to duplicate his message but will tell you what I've
done.

I'm also running two CUP servers for our SAP printers and ran into
the same sync issue.  With 2700+ printer queues and jobs are processed
every second, I can't afford a stop/start without prior scheduling.

Basically, I've created scripts to allow users with proper access rights to add, delete, or change printer queues. The same command is
then executed on the partner server via ssh.

For example, on Server A, a user created a new printer queue with the
following command:

lpadmin -p $qname -D "$qdesc" -L "$qloc" -E -v $uri$qIP -m $driver 2>&1 1>> $userlog


The same command is then executed on the partner server, Server B, via
an ssh:

ssh $server2 $cupsspath/lpadmin -p $qname -D "'$qdesc'" -L "'$qloc'" -E -v $uri$qIP -m $driver 2>&1 1>> $userlog 2>/dev/null

If you noticed, there are lots of variables. This is because the user
is using a MENU to enter all the informations. I've written the script
so that the user can make the change on either server and the changes
will be made automatically on the other server.

I log every activity so that I know who's doing what:
...
040808-08:16:08 foo_user add lpadmin -h serverB -p mouq -D 'JPLJ4100' -L 'SLC,(210-2 ),PRMTNL PROD' -E -v socket://192.168.0.1 -m laserjet.ppd
...
040808-08:16:08 bar_user mod lpadmin -p mouq -h serverB -D HPLJ4100


I have two scripts, cupsptr and runcupsptr. The user execute cupsptr
which in turn calls the runcupsptr to initiate the MENU.

# ls -al cupsptr runcupsptr
-r-xr-x---  1 root lp   665 Aug 21  2007 cupsptr
-r-x------  1 cups lp 55951 Oct 15 14:48 runcupsptr

You can be as detailed in your script as you want, or not. Once you
have your scripts in place, you almost have nothing to do with the
servers anymore.


I hope that helps.

Thanks,
Angel




More information about the cups mailing list