Operating System - HP-UX
1832504 Members
4732 Online
110043 Solutions
New Discussion

Cant add a remote printer

 
SOLVED
Go to solution
Scott Dunkley
Regular Advisor

Cant add a remote printer

I am trying to add a remote printer using SAM but it keeps saying the printer already exists on my server which it doesnt, why would this happen ?
Better to regret something you have done, than something you havn't
3 REPLIES 3
Steve Steel
Honored Contributor

Re: Cant add a remote printer

Hi


I bet part of it does


Do
lpadmin -xprinter

On the command line and try again


Steve Steel

Do not meddle in the affairs of Unix, for it is subtle and quick to core dump.
If you want truly to understand something, try to change it. (Kurt Lewin)
Armin Feller
Honored Contributor
Solution

Re: Cant add a remote printer

HPUX 11.x

Recent changes to the SAM lpmgr script use the return code from the
lpstat command to determine if a printer exists or not (a non-zero
return code should say that the printer does not exist).

However lpstat under some circumstances unconditionally returns a
zero return code no matter what the printer name:

# lpstat lp ; print $?
lpstat: "lp" not a request id or a destination
0

In this case the exit status of lpstat should be "1" not "0".

This only happens on both HP-UX 11.0 and 11i version 1.

The problem only occurs when the directory /var/opt/pd/pdclientd exists.
This directory gets created when HPDPS is configured to start and run. If you
stop HPDPS, disable HPDPS from running, and then remove the directory the
problem stops happening (lpstat returns a "1" for the exit status).
Stopping HPDPS and then disabling it from restarting at the next reboot
prevents the problem from reoccuring.

This is a known problem with SAM and lpstat.

A workaround has been identified that allows SAM to work properly
if HPDPS is activated. Both remote and local printers can be added
and removed by SAM after the following change is made to the
/usr/sam/lbin/lpmgr script:

To change /usr/sam/lbin/lpmgr:
# cd /usr/sam/lbin
# cp -p lpmgr lpmgr.orig
# vi lpmgr
[Locate the function does_printer_exist on line 2462.]
[Change the if statement on line 2464 from:]
replace:
if lpstat $1 > /dev/null 2>&1
with:
if lpstat -p$1 2>&1 | grep -v non-existent > /dev/null 2>&1

To turn off HPDPS, turn off the startup script for the pdclientd in
/etc/rc.config.d/pd PD_CLIENT=1 (change this to 0)

Also check that these are commented out:

PD_SPOOLERS="
"
PD_SUPERVISORS="
"

NOTES: 1.) As these parameters (PD_SPOOLERS and PD_SUPERVISORS)
have a second line, be sure to also comment out the second line below each
parameter (one double quote mark.) 2.)For additional help with disabling HPDPS,
see Doc ID: KBRC00001378 DPS ("How to delete the current configuration and start
over")

Armin Feller
Honored Contributor

Re: Cant add a remote printer

The problem should be fixed with following patches:

PHCO_27020 s700_800 11.11 lpspool subsystem cumulative patch
PHCO_27132 s700_800 11.00 lpspool subsystem cumulative patch

You can download them by:

ftp://europe-ffs.external.hp.com
--> hp-ux_patches
--> s700_800
--> 11.X

You have to unwrapp the patch after downloading using 'sh' and then install the .depot file using swinstall.

Regards,
Armin