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?
 
jlmsConnect With a Mentor Commented:
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.