Operating System - HP-UX
1837523 Members
3948 Online
110117 Solutions
New Discussion

setting up a dummy printer

 
SOLVED
Go to solution
Unix Administrator_5
Frequent Advisor

setting up a dummy printer

I need to set up a printer that accepts
requests but does not actually print anything -- maybe sends it to /dev/null. I have an application that requires a print queue be active; however, we have no need to print.
8 REPLIES 8
Mark Grant
Honored Contributor
Solution

Re: setting up a dummy printer

Simple, set up a printer whose device is /dev/null

lpadmin -p dummy -i dummy -v /dev/null

or something very similar :)
Never preceed any demonstration with anything more predictive than "watch this"
Unix Administrator_5
Frequent Advisor

Re: setting up a dummy printer

can i use hippi to do this?
Mark Grant
Honored Contributor

Re: setting up a dummy printer

I don't know because I don't know what hppi is. You can probably do it with sam though. Just specify /dev/null as the device.
Never preceed any demonstration with anything more predictive than "watch this"
doug mielke
Respected Contributor

Re: setting up a dummy printer

I don't think hppi will give you a choice of /dev/null.

lpadmin will though.

Also, this /dev/null printer is handy for when you have many print jobs to delete.
rather than using cancel, you can lpmove the failed jobs to this bogus printer to dispose of them.
Unix Administrator_5
Frequent Advisor

Re: setting up a dummy printer

I was able to create the queue with the following command;

lpadmin -pdevnullprinter -esome_existing_printer_script -v/dev/null

However, all jobs sent to it queue
even after accpet and enable.
doug mielke
Respected Contributor

Re: setting up a dummy printer

lpadmin -pbogus -i/dev/null -v/dev/null

This should create printer bogus that will send print jobs to dev/null
doug mielke
Respected Contributor

Re: setting up a dummy printer

Hello UA,
It appears that your existing model / interface script disables your printer when it gets a non zero return code after the job attempts to print.
( If enable printername can be run twice in a row, and the second time you do not get an already enabled messege, this is likely whats happening.) This causes the jobs to stay in the queue.

the above lpadmin -pbogus -i/dev/null -v/dev/null works. I guess we never error when reading /dev/null as an interface input?
Unix Administrator_5
Frequent Advisor

Re: setting up a dummy printer

I was finally able to get this to work by doing the following:

lpshut
lpadmin -pdevnullprinter -mdumb -v/dev/null
lpsched
accept
enable