Solved

Solaris 2.6 and 7 printcap and printers.conf entry

Posted on 2000-04-13
16
994 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

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
 

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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

821 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