HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

lpmgr exit values

 
SOLVED
Go to solution
Sunny Jaisinghani
Trusted Contributor

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
5 REPLIES
Mel Burslan
Honored Contributor
Solution

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...

Re: lpmgr exit values

Looking at lpmgr as Mel suggests shows that you have a failure. 4 is COM_RC_FAILED.
Sunny Jaisinghani
Trusted Contributor

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



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.
Sunny Jaisinghani
Trusted Contributor

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