Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Butler Trumpet

macrumors 6502a
Original poster
May 26, 2004
524
418
Dekalb IL
The school I work for (not Butler... even though thats my username) has tasked me with building a CUPS server to use in our of our labs.

The goal is to print from a lab machine (Dual boot iMacs) to one of two printers that are connected to a print server. The print job needs to be manually released by the lab attendant to one of two printers in the lab that will be randomly selected. (This keeps one printer from doing all the work)

I hear that I can use CUPS to do this, but don't have much experience with CUPS.

The server is a Mac mini currently running 10.8, but it can easily run Windows or Ubuntu (or something similar) if needed.

Any thoughts?

Thanks!
 
The school I work for (not Butler... even though thats my username) has tasked me with building a CUPS server to use in our of our labs.

The goal is to print from a lab machine (Dual boot iMacs) to one of two printers that are connected to a print server. The print job needs to be manually released by the lab attendant to one of two printers in the lab that will be randomly selected.
There are a number of ways to set up a load balanced print queue that does this automatically. CUPS can do it built in, and the tool called Papercut may work better for you. In any case, this shouldn't have to be a manual operation.
 
I hear that I can use CUPS to do this, but don't have much experience with CUPS.

I ASSume that you're aware that OS X uses CUPS under the covers as the print spooler system. Get thee to a terminal window on your print server and type the following:

cupsctl WebInterface=yes

From there, open up a web browser on the print server console and browse:

http://localhost:631/

All of the help docs are sitting right there, and you can figure out the logon credentials when you're ready to make changes.

I'll suggest creating a "class" first, which is a pool of identical printers that round-robin like you want. Make both of your lab printers members of the class, and then configure your lab clients to print to the class name and not an individual printer. This should satisfy your main requirement.

If the powers that be still want to play games holding jobs until a lab assistant releases them, you can probably create a single CUPS print queue with auto-hold enabled, sending on to the class CUPS IPP queue above via ipp://localhost:631/classes/queuename (or whatever the URL is for a class).

I have never really played with CUPS on OS X, but have pounded it into the ground on Linux. If you want to take your lab concept to the next generation, I developed a whole network print subsystem that had ethernet time clock terminals at each printer with card swipers. Users would swipe their ID card at any printer on campus, the terminal would telnet back to the print server, look up any jobs in the hold queue for that user, and release them to the printer nearest the swiper after doing page accounting. One swiper could handle multiple printers, so the user could be prompted for which printer of two or more on the counter was to print the job. Simple follow-me printing. I'm not offering to share the code, just giving you a target for a bigger picture.

Personally, as chrfr suggested, take a look at PaperCut-NG. The pricing is cheap enough for an academic environment where it really isn't worth the effort to re-invent it with CUPS, and if your school goes into a cost-recovery model by charging for printouts beyond so many per month then you will probably recover the software cost in only a few months. We're using PaperCut-MF now, which even does copier chargeback in the libraries and other student-access copiers.....
 
Great! Thanks for the reply chrfr and vreihen

I knew CUPS was the backend to print on the Mac to begin with - and had gotten to the UI, but hadn't gotten much farther than that. I'll look in to all of these solutions and let you know.

Thanks!
 
I'll suggest creating a "class" first, which is a pool of identical printers that round-robin like you want. Make both of your lab printers members of the class, and then configure your lab clients to print to the class name and not an individual printer. This should satisfy your main requirement.

If the powers that be still want to play games holding jobs until a lab assistant releases them, you can probably create a single CUPS print queue with auto-hold enabled, sending on to the class CUPS IPP queue above via ipp://localhost:631/classes/queuename (or whatever the URL is for a class).

Alright - I added a Class and added two printers to it. Now when I print from a lab machine it prints to the printers at random just like I wanted.

What I can't figure out is how to hold the jobs until release. I can only figure out how to pause or reject jobs for the printers individually, or through the class. But I'm not sure how to create a single CUPS print queue with auto hold enabled.

Any advice there?
 
# lpoptions -p printername -o job-hold-until=indefinite

I didn't try it specifying a class for the printername. If it doesn't, just create a print queue to hold and then "bounce" the released job to your class. Also, there are other options for job-hold-until that you might find useful if your logic is a little bit flexible.....
 
# lpoptions -p printername -o job-hold-until=indefinite

I didn't try it specifying a class for the printername. If it doesn't, just create a print queue to hold and then "bounce" the released job to your class. Also, there are other options for job-hold-until that you might find useful if your logic is a little bit flexible.....

Sorry for the slow response... I've been working on other labs the last week or so. Anyway... exactly do I put that line of command?
 
In a terminal window on the CUPS print server. You might need to be logged on as an admin or sudo to root. It worked straight up on my computer.....
 
In a terminal window on the CUPS print server. You might need to be logged on as an admin or sudo to root. It worked straight up on my computer.....

Terminal takes the command with no troubles - but when I print from a users machine it just goes right through without having to be released.

I can easily pause the class (that has two printers in it) and then manually move the print job to one of the two printers, but that is not ideal.

As far as I can tell there is no way to hold the job (other than pausing the class) and then release it so that it randomly picks the printer.
 
Last edited:
I just tried it again, and it held a job submitted by "lp -d printername", but let a CUPS test page to the same queue pass straight through. I give up trying to make sense of this OS..... :confused:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.