How to setup a Virtual Print Queue in Solaris?

Hi expert,

I am using Solaris 2.4 and wish to configure a virtual
print queue (pure text) so that all output from that
print queue are redirected to a particular directory ?
For example, I wish to configure a print queue called
"vir_pq" and all output to queue "vir_pq" are routed
to the directory /var/spool/lp/vir_pq/. In other words,
the whole content of the output reside at that directory.

How can I do that in Solaris 2.4? Please advise.

Regards, D-Square
chengwidAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jlmsCommented:
You have to write a filter that takes the information and makes a copy of it to a given directory. You have to check the System Administration manual, it has a complete chapter about printer managment including a lot about filters.
0
jlmsCommented:
So, exactly what didn't you like  of my answer? I would like to explain everyhing about filters, but is too long to be included here. Check the man page of lpadmin to see how to create a printer queue (here you can specify the name and location of your filter). Then, what you do in your filter program depends enterly in your needs,, if you just want to keep the files then you don't even need a filter, just disable the printer queue without disabling queuing and all with remain in /var/spool/lp/....



0
chengwidAuthor Commented:
Hi Jim,

Thanks for your answer. However, I need a brief description
on setting up the virtual queue. If you tell me to consult
the man page, then I don't have to post this question in
the first place. What I need is a procedure to setup a
(text) virtual print queue in Solaris ? My expected answer
should look like this (example):

Step 1: Execute "lpadmin"

Step 2: On the queue name section, enter a dumpy
        queue name such as vir_prt

Step 3. ...

Just a brief procedure is fine. You don't need to give
me the details of the mechanism in behind. That's
all what I need. Thanks for your time. I look forward
to receiving your reply soon. Have a nice day.

Reegards,

D-Square

0
jlmsCommented:
Here we go:

Type:
touch /dev/dummy
chown lp /dev/dummy
chgrp lp /dev/dummy
chmod 0600 /dev/dummy
lpadmin -p yourprinter -v /dev/dummy

With this steps you have created a printer called "yourprinter" and a dummy device, this dummy thing could be anyware but  better in a place where nobody can tamper with it.

After this go to the directory /etc/lp/interfaces, here you will find a file called yourprinter, edit it and search for the next lines:

#####
#
# Additional ``parameters'' are passed via Shell environment
# variables:
#
#       TERM    The printer type (used for Terminfo access)
#       CHARSET The character set to choose
#       FILTER  The filter to run
#####                              

Immediatly after this add something like:

FILTER="cat > /spool_directory_you_choose/printer_file$$"

This line will create a file called printer_filennnn where nnnn is a number related to the process id of the script and for this reason unique. Of course you can adapt this to something more convinient for you.

Then type:
enable yourprinter
accept yourprinter

And giv it a try.


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.