Operating System - HP-UX
1832617 Members
2634 Online
110043 Solutions
New Discussion

Re: Making ptr changes w/out stopping spooler

 
Vince Laurent
Respected Contributor

Making ptr changes w/out stopping spooler

We have a lot of unix printer queues that we are trying to manage (we are implementing SAP). One issue we have now is a lot of printers have been set up with the wrong IP address. Is there a way to directly change the IP of a printers without stopping/starting the spooler? A problem arises when the spooler is stopped/started that print jobs restart - this is a VERY BAD thing for check print runs! So what I would like to do is change:

(sapdev):/etc/lp/interface:root# lpstat -v007_f2_laser
device for 007_f2_laser: /dev/null
remote to: text on 165.104.105.38

to the correct IP with no system interuption.

Thanks!
12 REPLIES 12
James R. Ferguson
Acclaimed Contributor

Re: Making ptr changes w/out stopping spooler

Hi Vince:

How about using the DNS name instead of the IP address? Then you should not have the issue4.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: Making ptr changes w/out stopping spooler

You would have had no problems had you used /etc/hosts, DNS, or NIS for hostname resolution. I know that works 'on the fly'.
In all my years as an admin, I've never tried to do this in that it would never have occurred to me to print to an IP address. The best advice I can give is: pick an idle printer and make the change.
If it ain't broke, I can fix that.
Vince Laurent
Respected Contributor

Re: Making ptr changes w/out stopping spooler

Well, the horse is out of the barn and we have IP addresses. Even if the printer is idle when you make the change in SAM it stops and restarts the spooler - again NOT a good thing.
Patrick Wallek
Honored Contributor

Re: Making ptr changes w/out stopping spooler

The thing I think I would try is this:

disable the printer
vi the /etc/lp/interface/printer_name file and look for the line PERIPH=ip.address.of.printer and change the IP. Save the file.
enable the printer

Now send a test print and see what happens. I haven't actually tried this, so there are no guarantees that it will actually work.

I personally agree with Clay and JRF that you should be using some sort of name resolution instead of IP addresses. Then if you need to change the IP, you change it in /etc/hosts or DNS, disable and enable the printer and your are going again.

Good luck.
A. Clay Stephenson
Acclaimed Contributor

Re: Making ptr changes w/out stopping spooler

Ni Vince: I meant change the lp files directly without doing an lpshut/lpsched.
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: Making ptr changes w/out stopping spooler

Hi (again) Vince:

My point is whether or not you have to bite this bullet, change to hostnames in lieu of IP addresses. In my case, I use DNS for the hostname resolution. I do not code IP addresses. At the very least, use /etc/hosts (as Clay suggested).

Regards!

...JRF...
Vince Laurent
Respected Contributor

Re: Making ptr changes w/out stopping spooler

vi the /etc/lp/interface/printer_name file and look for the line PERIPH=ip.address.of.printer

That line does not exist in the file.

I personally agree with Clay and JRF that you should be using some sort of name resolution instead of IP addresses.

Next time

I meant change the lp files directly without doing an lpshut/lpsched.

What files specifically? This is what I have been trying to do.

Thanks for all your help!
BTW, we are running HPUX11.00...
Vince Laurent
Respected Contributor

Re: Making ptr changes w/out stopping spooler

My point is whether or not you have to bite this bullet, change to hostnames in lieu of IP addresses. In my case, I use DNS for the hostname resolution. I do not code IP addresses. At the very least, use /etc/hosts (as Clay suggested).

I think I will work on some sort of DNS/hosts thing for the future. Thanks.
Patrick Wallek
Honored Contributor

Re: Making ptr changes w/out stopping spooler

OK. Try this then:

cd to /etc/lp
pick a printer name and do a 'find . -name printer_name' and get the list of files in /etc/lp directory structure.

Then in each file do a 'grep ip.address.of.printer filename' to try to find which file the ip is specified in. Once you find that you can change the IP.
Vince Laurent
Respected Contributor

Re: Making ptr changes w/out stopping spooler

(sapdev):/etc/lp:root# find . -name 007_f2_laser
./cinterface/007_f2_laser
./interface/007_f2_laser
./member/007_f2_laser
./sinterface/007_f2_laser
./interface.old/007_f2_laser

(sapdev):/etc/lp:root# find . -name 007_f2_laser -exec grep 165 {} \;

nothing comes back...there is no IP stored in any of those files.

I found the IP address in /var/spool/lp/pstatus but it is a binary file and I don't know how to edit it.
Patrick Wallek
Honored Contributor

Re: Making ptr changes w/out stopping spooler

Hmmm.....Are you printing directly to these printers from your HP-UX box via jetadmin? Or are you going through another box?
Vince Laurent
Respected Contributor

Re: Making ptr changes w/out stopping spooler

Whoo hoo! I got it to work. On one of our other HPUX systems there is a binary editor. I managed to change the IP address in the pstatus file and now it prints! Now to make everything use DNS...

Thanks everyone for all your help!