The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Operating Systems > HP-UX
.
grep unix.com with google



HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

Reply
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-26-2009
Registered User
 

Join Date: Nov 2009
Posts: 2
Logins command exit status is 236 not 0

I have noticed that on version 11.23 I get exit status 236 from the
following command:

logins -oxl root ; echo $?
> 236

However on 11.31 I get the expected code 0

logins -oxl root ; echo $?
> 0

The output is correct for both versions and contains no error data.
Can anyone explain this ? Its causing problems with some automation
we are using which calls the logins command and check the exit status.

---------- Post updated 26-11-09 at 12:01 PM ---------- Previous update was 25-11-09 at 03:47 PM ----------

Update:
Further investigation as revealed this is hardware dependent.

IA64 with 11.23 OK exit code 0
IA64 with 11.31 OK exit code 0

RISC with 11.23 FAIL exit code 236 ******

IA64 with 11.31 OK exit code 0
RISC with 11.23 OK exit code 0

We still do not know why this is happening, still would love some
feedback if you can explain this..
  #2 (permalink)  
Old 11-26-2009
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 6,006
the wait() system call returns the lowest 8 bits of the actual return code.
It is treated as if it were an "unsigned char" in effect. It is not. So, negative small numbers returned become return values > 127, for example. Think ~(return value), we saw this on migrating from 11.0 to HPUX 11.23 PA_RISC-2 boxes, running 32 bit mode code. The 11.0 code is binary compatible, so we did not recompile.

Create a hashed alias in /etc/profile: a shell script wrapper for logins. It masks the return value to zero or 1. We ran into other commands that do this as well.
  #3 (permalink)  
Old 11-27-2009
Registered User
 

Join Date: Nov 2009
Posts: 2
Thanks that was very useful information. To round this off is there any HP formal documents describing this as working as designed ? or would a defect be an acceptable path.

Though the described work around is fine for me on the command line. We have discovered that the 3rd party software hangs with the workaround in place. So its likely the 3rd party needs to adjust the application or HP would need to return correct exit codes i.e '0' for success.
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
command does not return exit status due to tee anand_bh Shell Programming and Scripting 2 12-05-2008 12:20 PM
Move Command and exit status problem visingha Shell Programming and Scripting 10 09-13-2008 09:08 PM
Move Command and exit status problem visingha UNIX for Dummies Questions & Answers 1 09-12-2008 03:14 AM
exit status of command in a pipe line topcat8 UNIX for Dummies Questions & Answers 10 10-19-2007 05:39 AM
Getting the exit status of a remote command zoonalex Shell Programming and Scripting 1 08-23-2006 05:58 PM



All times are GMT -4. The time now is 12:30 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0