Unix/Linux Go Back    


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

C Exit Not Executing

AIX


Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 4 Weeks Ago   -   Original Discussion by jeffs42885
jeffs42885 jeffs42885 is offline
Registered User
 
Join Date: Nov 2010
Last Activity: 17 November 2017, 3:54 PM EST
Location: PA
Posts: 105
Thanks: 15
Thanked 0 Times in 0 Posts
C Exit Not Executing

Greetings all,

I am using an enterprise utility for document archiving. This program calls a custom C exit to do data manipulation before loading data into the archive.

When the program is called via an automation script (Ran as ROOT), program successfully executes the C exit, and gives me an RC 0.

When I try to execute the same program, I get a return code 16. I suspect that this is because of the exit. When I remove the exit from the processing, the program runs fine.

My account on the server has full sudo access.


Code:
-rwxr-xr-x    1 root     system        12342 Feb 19 2010  CustomExit

Can't seem to figure this out but I have a sneaking suspicion that this is due to permissions somewhere, since ROOT can run it, but my SUDO ID cant.

I've engaged vendor support, and they haven't helped. Anyone have an idea?
Sponsored Links
    #2  
Old Unix and Linux 4 Weeks Ago   -   Original Discussion by jeffs42885
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 17 November 2017, 6:09 PM EST
Location: NM
Posts: 11,238
Thanks: 570
Thanked 1,116 Times in 1,030 Posts
I am assuming the LD_LIBRARY_PATH works in AIX as it does elsewhere. Please correct me if this is a bad assumption. EDIT: checked - 5.1 AIX and earlier uses LIBPATH, which may be brought forward to other newer releases. Newer releases use LD_LIBRARY_PATH as I expected.

See if you can successfully run the ldd command as yourself against the compiled program. Try it again as root user.

It could be that LD_LIBRARY_PATH needs to change for your user. The differences in output of the two ldd commands should give you a clue.

As an aside, subverting/reinventing system calls like exit() is generally a poor idea. And it is sometimes done by using replacement shared libraries and/or changing the LD_LIBRARY_PATH order of shared libraries.
Sponsored Links
    #3  
Old Unix and Linux 4 Weeks Ago   -   Original Discussion by jeffs42885
jeffs42885 jeffs42885 is offline
Registered User
 
Join Date: Nov 2010
Last Activity: 17 November 2017, 3:54 PM EST
Location: PA
Posts: 105
Thanks: 15
Thanked 0 Times in 0 Posts
When I do an ldd against the exit itself as my own user -


Code:
 
 user@server:/dir/to/exit> ldd CustomExit
 CustomEXIT: No such file or directory

toss in sudo-


Code:
user@server:/dir/to/exit> ldd CustomExit
CustomExit/usr/lib/libcrypt.a(shr.o)
/usr/lib/libc.a(shr.o)


Code:
user@server:/dir/to/exit> echo $LD_LIBRARY_PATH
/usr/lpp/psf/bin

    #4  
Old Unix and Linux 4 Weeks Ago   -   Original Discussion by jeffs42885
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 17 November 2017, 6:09 PM EST
Location: NM
Posts: 11,238
Thanks: 570
Thanked 1,116 Times in 1,030 Posts
Just because you have sudo does not mean your run as root all the time, which is what that ldd example shows. I'm not sure about the AIX syntax of the result - specifically the (shr.o)

It appears to be an object file file - somewhere - perhaps linked into the CustomExit code.

If an AIX person sees this it may help both of us. But IMO, you have some sort of permission issue. Example: the CustomExit code calls setuid()

Does nm CustomExit work for you (after sudo)? Please post the output.

And do you have a way of finding what exit code 16 - the error number - means for that app? Please post it if yes.
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Executing 'exit' command from shell script Mahesh Desai Shell Programming and Scripting 4 12-14-2014 05:44 PM
Executing multiple processes without waiting for their exit status. singh.chandan18 Shell Programming and Scripting 3 11-19-2010 11:17 AM
nohup - sub job in script not executing until I exit ido1957 UNIX for Dummies Questions & Answers 2 08-17-2010 08:08 AM
bash: executing commands and reading exit vals eur0dad Shell Programming and Scripting 7 07-18-2006 08:42 AM



All times are GMT -4. The time now is 02:37 AM.