Home Man
Today's Posts

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


Login to Reply

Thread Tools Search this Thread
# 1  
Old 10-15-2017
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.

-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?
# 2  
Old 10-15-2017
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.
# 3  
Old 10-16-2017
When I do an ldd against the exit itself as my own user -

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

toss in sudo-

user@server:/dir/to/exit> ldd CustomExit

user@server:/dir/to/exit> echo $LD_LIBRARY_PATH

# 4  
Old 10-16-2017
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.
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to keep staying on remote server after executing a shell script with if then exit end statement? moonmonk Shell Programming and Scripting 10 11-08-2016 03:08 AM
Executing 'exit' command from shell script Mahesh Desai Shell Programming and Scripting 4 12-14-2014 04:44 PM
Execute shell script and if string found while executing then exit ORAI UNIX for Dummies Questions & Answers 7 09-10-2014 03:27 PM
Need the difference between exit 1 & exit 7 ginrkf Shell Programming and Scripting 3 05-06-2013 11:38 AM
Executing multiple processes without waiting for their exit status. singh.chandan18 Shell Programming and Scripting 3 11-19-2010 10:17 AM
nohup - sub job in script not executing until I exit ido1957 UNIX for Dummies Questions & Answers 2 08-17-2010 07:08 AM
exit(0) versus exit(1) enuenu Programming 9 06-22-2007 10:56 AM
bash: executing commands and reading exit vals eur0dad Shell Programming and Scripting 7 07-18-2006 07:42 AM
Where can I find a list of exit codes? (Exit code 64) jkuchar747 UNIX for Dummies Questions & Answers 3 12-07-2004 05:08 PM

All times are GMT -4. The time now is 11:21 PM.

Unix & Linux Forums Content Copyright©1993-2018. All Rights Reserved.
Show Password