Solved

How to setup a Virtual Print Queue in Solaris?

Posted on 1997-07-07
4
1,308 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
llcommand 6 76
Snap images to the bottom of a div 5 62
jQuery Date picker not working 16 75
mobaxterm not able to change directory 28 48
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now