?
Solved

How to setup a Virtual Print Queue in Solaris?

Posted on 1997-07-07
4
Medium Priority
?
1,342 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 200 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses
Course of the Month17 days, 7 hours left to enroll

830 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