Solved

Solaris 2.6 and 7 printcap and printers.conf entry

Posted on 2000-04-13
16
990 Views
Last Modified: 2013-12-21
For both the Spac and Intel version 2.6 and 7, is there an entry that I can put in the printcap or printers.conf file to get rid of the dreaded Staircase effect when printing.  I've written shell scripts to take care of this, but I'm looking for an easier way.  This is a remote printer and I don't have access to the remote system, only the printer.  Also worth noting, the printer does not have a setting to set lf->cr/lf.  I'm looking to do the conversion berfore the job is sent to the remote system.  For HP, I modified the rmodel interface script, but HP's printing system is different from Solaris.  
0
Comment
Question by:hpman
  • 7
  • 3
  • 3
  • +2
16 Comments
 
LVL 2

Expert Comment

by:jonke
ID: 2712716
What sort of printer are you using? A typical example for an HP Deskjet would be:

Step #1. Adding "of" line to printcap          

 
hp|hplj|HP_Deskjet1600c:        :lp=/dev/bpp0:\        
        :sd=/var/spool/lpd/hp:\        
        :of=/usr/lib/deskjet.filter:\   ---->Add this line.
        :sh:sf:sb:mx#0:
       
Step #2. Creating the filter.
-----------------------------    
# vi /usr/lib/deskjet.filter
Add the following info to the file.
Note. Make sure you include the single quotes where applicable and following
instructions below to insert the escape codes correctly or filter will not
work.
The '&k2G' is to correct the staircase effect and 'E' is to eject the page.

 
#!/bin/csh -f
#
/usr/bin/echo -n '&k2G'
/usr/bin/cat
if      ($status == 0)  then
/usr/bin/echo -n 'E'
                exit 0
else
        exit 1
endif
#


How to Insert Escape Code
---------------------------

Note. Select "i" for insert mode under VI.
Inserting <esc>&k2G

Press '
Press "ctrl" and "v" keys together. This will produce a ^
Press "esc" key this will produce [
Enter &k2G
Press '

Use same procedure for <esc>E

To check the escape code was inserted correctly execute;
--------------------------------------------------------

cat -v /usr/lib/deskjet.filter    ---> Should appear as   '^[&k2G'

Permissions
-----------

chmod 755 /usr/lib/deskjet.filter
0
 

Author Comment

by:hpman
ID: 2712832
The printer is an Océ 3165 which has an OS/2 PC as a controller.  This is why I need to do the conversion before it is sent to the remote system.  Currently, I have access to the Intel version of Solaris.  It's printers.conf file looks completely different than what you described.  The entries look like this:  3165:\ (next line down):\bsdaddr=3165,dac,Solaris:  If I put the if/of=/var/lib/3165.filter before the second line, the system tells me the printer is unknown.  If I put it after, I still get the staircase.  I'm working on getting access to a Sparc station to see if your solution works there.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2714630
Solaris doesn't use a printcap file, it being a SysV printing system. What printer type are you using on Solaris to print to the device? Does the printer do a Postscript or PCL emulation?
0
 

Author Comment

by:hpman
ID: 2716043
The printer is capable of both.
I copied the /etc/printers.conf file to the tmp directory and used conv_lpd to convert the copy from a printers.conf file to a printcap entry.  I added the of=... line and then used conv_lpd to convert it back and used the /tmp/printers.conf.  It made no difference.  I've also tried editing the /usr/lib/lp/model/standard and forcing the filter to equal the location of my script.  Any help would be greatly appreciated.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2718248
You could set the printer type neatly for a network printer with Solstice AdminSuite, but it can also be done via a command line. Since you say it can do both Postscript & PCL, we'll set it up as a Postscript printer as that's more compatible with Solaris. I'm assuming that you can send jobs to the remote printer via BSD LPR/LPD protocol.

The first thing to do is to see if the SysV printer filters have been set up with "lpfilter -l -f all". If there aren't any listed, the easiest way to get the system to set them up is to add (and then remove) a dummy postscript printer with admintool. Just tell it that the printer is local on any port, it doesn't matter which.

Verify that "lpfilter -l -f all" now shows filter types, and then you can set up a network printer. In the example below I've used "prt" for the queue on the node "printer.on.net". You'll need to change the remote queue name and nodename to suit. Create the queue for a remote networked printer with:

root> lpadmin -p prt -T PS -I PS -F continue -o nobanner \
> -h -v /dev/null -m netstandard -o dest=printer.on.net \
> -o protocol=bsd -D "PS Printer"

I normally disable banner page printing by editing the interface file (/etc/lp/interfaces/prt in this example) and change "nobanner=no" to "nobanner=yes".

Then enable printing with:

root> enable prt
root> accept prt

You can look at the man pages for the commands I've used for more info.
0
 

Author Comment

by:hpman
ID: 2737996
Adjusted points from 20 to 100
0
 

Author Comment

by:hpman
ID: 2737997
I'm thoroughly confused!  Your suggestion did not work.  I've tried just about every option for lpadmin.  The last attempt that has me so confused is what interface script is actually being run?  I used the following commands to create a basic remote printer
lpadmin -p test -s dac ! test -v/dev/null (or use admintool to create a remote printer)
I can print to the printer.  I next create an executable called test which does nothing more than cat "hello" to a tmp file.  I used the -i and -m options for lpadmin to point to this.  Nothing appears in the tmp directory and the job prints.  With HP, rmodel is used for remote printers.  I modified that script for this printer and it works fine.  I've tried modifying both the standard and netstandard files, but from the above test, they don't seem to run for a remote printer.  Any idea's would greatly be apprciated.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2738277
It may not have worked when you used my example as the "remote printer" might not implement the BSD LPR/LPD printing service (or perhaps not in an RFC compliant manner). Is it a "raw network" service or is it supposed support the LPR/LPD protocols?
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:hpman
ID: 2738573
It's supposed to support LPR/LPD.  
0
 
LVL 5

Expert Comment

by:ianB
ID: 2855596
We have opened up a new Solaris Topic Area.  

To increase the visibility of questions, we moved questions we felt
appropriate to the new Solaris Topic Area where they will be easier for
Solaris experts to find and answer. You may view your question at
http://www.experts-exchange.com/Computers/Operating_Systems/Solaris/

If you have any questions about the new topic area you can contact
Community Support by posting a comment at the following URL or by
emailing us at cs@experts-exchange.com.
http://www.experts-exchange.com/Customer_Service/Experts_Exchange/

Ian
Community Support @ Experts Exchange

0
 
LVL 2

Accepted Solution

by:
Geddy earned 100 total points
ID: 2997453
I have 2.6 and 2.7 boxes here where I work. In our printer.conf file,
this is how we have them setup.

#
#       If you hand edit this file, comments and structure may change.
#       The preferred method of modifying this file is through the use of
#       lpset(1M) or fncreate_printer(1M)
#
nocprint:\
        :bsdaddr=foulmouth.core.rl.af.mil,text,Solaris:
_default:\
        :use=nocprint:

When I added the printer through the admintool, I also was getting the
staircase effect. Once I looked at one of our other boxes here with these settings, and changed them appropriately, that effect went away.

In the example above, "nocprint" is the printername, foulmouth is the hostname to DNS resolves for nocprint's IP.

All I can say is, the above setting worked for me. I think that "text" and "Solaris" were missing from the entry when I tried to add the printer with the admintool.
0
 
LVL 2

Expert Comment

by:Geddy
ID: 3075812
Whoa, I think I had points taken away from me on this one. Wasn't this answer accepted middle of last week?
0
 

Author Comment

by:hpman
ID: 3075990
You should have gotten the points.
0
 
LVL 2

Expert Comment

by:Geddy
ID: 3076070
Initially, I did, but it looks like they were taken away. I wonder if it had anything to do with Experts Exchange server crashing. Another guy on here I know said that the server crashed. He lost points, and comments. I seem to have lost comments from other questions as well.
0
 

Author Comment

by:hpman
ID: 3076230
This was the e-mail that I received this morning.  I don't know who you would contact.

Dear Experts Exchange Members,
 
As many of you noticed yesterday, our site was having significant technical
problems. Late Friday night, our third-party hosting facility suffered a
severe crash and our site went down as a result.  We've worked non-stop to
recover and rebuild our site and database hosted on their servers. As we
send out this e-mail, the site is back up and we'll be monitoring it around
the clock to ensure its stability.
 
We sincerely thank all of you for your patience. We're taking steps to make
sure that this will never happen again.
 
Needless to say, it's an exciting time to be a part of the Experts Exchange
community. We value your contribution to the site, and are planning several
new enhancements in the near future that will make Experts Exchange even
better!
 
Thank you again for your patience,
The staff at Experts Exchange
0
 
LVL 5

Expert Comment

by:ianB
ID: 3110353
Comment accepted as answer
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

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

743 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

11 Experts available now in Live!

Get 1:1 Help Now