Re: lpmgr exit values (85 Views)
Reply
Trusted Contributor
Sunny Jaisinghani
Posts: 360
Registered: ‎01-03-2007
Message 1 of 6 (85 Views)
Accepted Solution

lpmgr exit values

Hell All,

I am trying to copy the printer configuration from one server and copy to another

Here are some logs from the samlog

when i run lpmgr -S

Snapshot successfully created.
@!@2@1231635688@0
lpmgr done, exit value is 4.


and

when i run lpmgr -S -xsavedir=/var/sam/lp

Snapshot successfully created.
@!@2@1231962273@0
lpmgr done, exit value is 0.


Why do i get different exit values when both commands are successfull

Thanks for your answers

Sunny
Honored Contributor
Mel Burslan
Posts: 3,214
Registered: ‎08-26-1998
Message 2 of 6 (85 Views)

Re: lpmgr exit values

This application is actually only for consumption by sam, not from the command line by itself. So the exit codes only have meaning to sam. What seem to be a unsuccessful exit code (like 4) may not be a indication of a problem at all but just a mere pointer to something mundane like the size of an export file or similar (I am making this up, so don't take it literally)

On the other hand, if you are really really curious, you can just edit the lpmgr script and try to figure it out on your own. It is quite messy but not rocket science after all. Script location is /usr/sam/lbin/lpmgr in case you need

Hope this helps
________________________________
UNIX because I majored in cryptology...
Acclaimed Contributor
Dennis Handly
Posts: 25,277
Registered: ‎03-06-2006
Message 3 of 6 (85 Views)

Re: lpmgr exit values

Looking at lpmgr as Mel suggests shows that you have a failure. 4 is COM_RC_FAILED.
Trusted Contributor
Sunny Jaisinghani
Posts: 360
Registered: ‎01-03-2007
Message 4 of 6 (85 Views)

Re: lpmgr exit values

Hello,

I couldn't find any link of exit value 4 and COM_RC_FAILED in the lpmgr script

Could you please paste a reference for me.

However, even if i get a exit value as 4 the log says that the snapshot was successfully created



Acclaimed Contributor
Dennis Handly
Posts: 25,277
Registered: ‎03-06-2006
Message 5 of 6 (85 Views)

Re: lpmgr exit values

>I couldn't find any link of exit value 4 and COM_RC_FAILED in the lpmgr script

There is a comment:
RETURN VALUES (see sam_utils and lp_utils)
(I couldn't find lp_utils.)

>even if i get a exit value as 4 the log says that the snapshot was successfully created

Someone is lying to you. :-) You need to make a copy of lpmgr and add "set -x" then see where it is failing.
Trusted Contributor
Sunny Jaisinghani
Posts: 360
Registered: ‎01-03-2007
Message 6 of 6 (85 Views)

Re: lpmgr exit values

Thanks for the clarification

I would prefer the command

lpmgr -S -xsavedir=/var/sam/lp

which gives me exit value as 0

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.