1819909 Members
2606 Online
109607 Solutions
New Discussion юеВ

Re: "Exit code" meaning

 
Bhavin Shah_2
Occasional Advisor

"Exit code" meaning

Hello All,

Can someone help with the list of exit code that appear in HP-UX & the meaning of the same.

Thanks & Regards
Bhavin Shah
11 REPLIES 11
Andrey Tumanov
Frequent Advisor

Re: "Exit code" meaning

There are no standard exit codes that all applications or commands
conform to. Most exit codes are hard-coded in source code and are not
easily available. The man page normally would explain the "return values" of a certain
function.
Torsten.
Acclaimed Contributor

Re: "Exit code" meaning

The exit code (not only in HP-UX) is a value given from the application to the environment.

The meaning is different from one application to another, so you have to read the documentation / man page for it.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
James R. Ferguson
Acclaimed Contributor

Re: "Exit code" meaning

Hi:

Convention dictates that a zero exit status indicates success whereas a non-zero exit status indicates failure.

Regards!

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

Re: "Exit code" meaning

Your question really has no meaning because exit codes mean exactly what the programmer intended - no more and no less. By convention, an exit code of 0 means all is well; also, by convention, exit codes match the value that errno was set to on the last failed system call (examine /usr/include/sys/errno.h) but really there is no hard and fast rule about the meaning of exit codes.
If it ain't broke, I can fix that.
MarkSyder
Honored Contributor

Re: "Exit code" meaning

To a great extent this is up to the individual programmer, but some programmers will adhere to the standard error messages in /usr/include/errno.h. E.g. 0 indicates success and 2 indicates file does not exist.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Chan 007
Honored Contributor

Re: "Exit code" meaning

Hi Bhavin,

Check this file has exit codes.

/usr/include/sysexits.h, this file can be view'd /cat

Chan
Bhavin Shah_2
Occasional Advisor

Re: "Exit code" meaning

Thanks for the reply.

I actually meant that while carrying out patch installation we get exit codes.

eg. PHSS_XXXX will be excluded with "exit code 3".

I would like to know how many such exit codes exit while carrying out such activity & what does that mean.

Regards
Bhavin Shah
Torsten.
Acclaimed Contributor

Re: "Exit code" meaning

Watch the logfile while installing something with swinstall or review the swagent logs in /var/adm/sw.

This will give you really a lot of information why a patch was excluded.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
MarkSyder
Honored Contributor

Re: "Exit code" meaning

Assuming the developers of swinstall used the standard codes in /usr/include/sys/errno.h (and I would be surprised if they didn't) error code 3 means "No such process". As advised earlier, you will need to read the swinstall log to find out which process.

Mark
The triumph of evil requires only that good men do nothing
Torsten.
Acclaimed Contributor

Re: "Exit code" meaning

In fact, the exit codes here are "SD internal" and coming from swconfig. see man swconfig.
You will find more detailed information in the swagent.log file.

Here are the codes:

0 (default) No identifiers are attached to messages.
1 Adds identifiers to ERROR messages only.
2 Adds identifiers to ERROR and WARNING messages.
3 Adds identifiers to ERROR, WARNING, and NOTE
messages.
4 Adds identifiers to ERROR, WARNING, NOTE, and
certain other informational messages.


Here is an example from my log, a patch cannot be installed, because my system is too old and not compatible:



NOTE: The "checkinstall" script for "PHSS_30183" gave an "exclude"
return (exit code "3"). The script location was
"/var/tmp/BAAa16565/catalog/PHSS_30183/pfiles/checkinstall".
NOTE: This software will be excluded from further processing.
NOTE: This product will not be installed because it is incompatible with
the microprocessor (CPU) on the destination system. It requires a
processor that can execute PA-RISC version 2.0 object code.
If you need additional information about this error message, contact
your HP Country Response Center or other HP-UX software support
personnel.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Fabio Ettore
Honored Contributor

Re: "Exit code" meaning

Hi,

like wrote by ITRC people you have to look in swagent.log file to understand the exact reason about the failure and not concentrate on the exit code. Anyway Torsten gave a good point with exit code meanings on SD-UX.

Please don't forget to assign points if you think people helped you.

If you are interested more then post the error message here.

Good luck...
Fabio
WISH? IMPROVEMENT!