Solved

How to setup a Virtual Print Queue in Solaris?

Posted on 1997-07-07
4
1,324 Views
Last Modified: 2013-12-16
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
0
Comment
Question by:chengwid
  • 3
4 Comments
 
LVL 4

Expert Comment

by:jlms
ID: 1812503
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
 
LVL 4

Expert Comment

by:jlms
ID: 1812504
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
 

Author Comment

by:chengwid
ID: 1812505
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
 
LVL 4

Accepted Solution

by:
jlms earned 50 total points
ID: 1812506
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

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa‚Ķ
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question