IDS11.50 on 64 bit linux restore from a program

Hi Everyone,

We have written a program that runs the onbar commands for backups and restores. We have no problems with this program until now.

Our program Logic:
- create two pipe pairs p1[2],p2[2]
- fork

- in the parent, close p1[0],p2[1]
- Use p1[1] to write to child process from parent
- use p2[0] to read from child
- keep reading from child until detect read pipe other end closed
- exit

- in the child
- close p1[1]
- close p2[0]
- setgid,setuid of the child to informix user gid and uid
-dup2(p1[0],STDIN_FILENO) to get input from parent
- dup2(p2[1], STDOUT_FILENO) to write stdout of this child to pipe being read by parent
-dup2(p2[1],STDERR_FILENO), same with stderr
- Run the onbar -r command using execv() API

this program works everywhere with earlier versions except IDS11.50. Now we see the below problem on X64 Linux (RHEL5.X) with IDS11.50 while using above program.

Problem Description:
Our program spawned child process to run "onbar -r" command and it ran successfully to end with return value 0. But we dont get that detected at read end (in the parent process). Our parent continues to try read and gets the errno=11 and never gets pipe-closed (return value zero).

*** we have also observed that, this parent read call get return value 0 when i shutdown that Informix server to which i did restore.
*** This is happening only when the restore is successful. When restore fails everything works normal.

Questions:
1. What is the relation between onbar process STDOUT/STDERRR and the informix server?
2.What is happening when I shutdown the informix server, how is the pipe getting closed when i shutdown the informix server? Is there any specific behavior added to IDS11.50 which is causing this?
3. We have been using the same program for a long time. We see this only on X64 Linux - IDS11.50 combination. Is there any thing wrong with the program being used that is causing this? If there is some thing wrong with the program, this should happen for any onbar command(backup/restore) which is not happening.

--
Thanks,
Ravi

Just to be clear

Hi,

So what you're saying is that it used to work with some earlier version of IDS and since you migrated to 11.50 it has stopped working? It has never worked with any previous version of 11.50? And furthermore, the ONLY thing that has changed is that you're using a new version of IDS - you haven't changed or patched your OS version?

Also, can you please confirm your exact version of IDS and RHEL?

Thanks for the reply

Thanks for the reply Spokey.

Yes, it worked with earlier versions of IDS (IBM Informix Dynamic Server Version 11.10.FC3)
From the above version, we switched to below mentioned version.
IDS:- IBM Informix Dynamic Server Version 11.50.FC1
RHEL:- Red Hat Enterprise Linux Server release 5.3 (Tikanga)

A better question

Hi,

Perhaps I should start this off again with a different question: what are you actually trying to do? Because I can't quite understand why you are doing what you're doing and what you hope to get out of it.