- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- notification of core generation by child to parent
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2005 10:23 PM
03-01-2005 10:23 PM
notification of core generation by child to parent
Also if the parrent is notified after the core is generated is there a mechanism via which the parent can become aware of the start of core generation immediately.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2005 11:01 PM
03-01-2005 11:01 PM
Re: notification of core generation by child to parent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2005 01:48 AM
03-02-2005 01:48 AM
Re: notification of core generation by child to parent
Thanks for the reply. Let me explain you the problem in some detail.
The parent process does a waitpid . So the parent will know when the child ends. Now here is the problem. I want to perform certain operations in the parent as soon as the child crashes or starts to generate core. If the child takes too long to generate a core file the parent process is not able to act as long as the file is being generated as only after the generation of the core the waitpid gets un-blocked.
There has to be some mechanism via which the parent or for that matter some other process can come to know of the core generation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2005 04:00 AM
03-02-2005 04:00 AM
Re: notification of core generation by child to parent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2005 04:10 AM
03-02-2005 04:10 AM
Re: notification of core generation by child to parent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2005 09:11 PM
03-02-2005 09:11 PM
Re: notification of core generation by child to parent
Gee, thanks (I think:o)
I agree that the solution is to fix the crashing process, but as I said, I haven't written anything that needs compiling for ages, so custom signal handlers are no longer in my repertoire. (And the question was about the parent dealing with the crash of the child.)
The defence rests, M'lud.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2005 10:29 PM
03-02-2005 10:29 PM
Re: notification of core generation by child to parent
Some ways around the problem are:
(a) Stop the child from core dumping, so it will exit immediately (as suggested in posts above).
(b) Provide the child with another mechanism to communicate with its parent.
The ideal sitiation would be that the child doesn't core dump in the first place! If you wish to see the core dumps (for debugging purposes) then that leaves option (b). Unfortunately (b) would require some code changes in both the parent and the child.
The mechanisms you can explore for communicating between the child and the parent are:
(1) The child traps signals (see sigaction(2)) that would lead to a core dump (see signal(5) for signals who's default effect is (ii) - i.e. core dump). These would be SIGABRT, SIGFPE, SIGTRAP, SIGQUIT etc).
(2) The child then either:
(a) sends a signal (see kill(2)) to the parent (which means the child needs to know its parent PID - not too difficult to determine, see getppid(2)). The parent traps the signal and now knows that the child is core-dumping. The parent does whatever it wants with the information.
(b) The child raises a semaphore to indicate that it is about to core dump. The parent will see the semaphore raised and do whatever it wants with the information.
(3) The child then continues with the default action for the signal, i.e. core dumps.
It depends on where you want to go and whether you have access to the child code I suppose?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2005 04:57 AM
03-03-2005 04:57 AM
Re: notification of core generation by child to parent
btw, just what sort of things do you want to try to do before/while the child process is dumping core?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2005 04:23 PM
03-03-2005 04:23 PM
Re: notification of core generation by child to parent
Thanks for the comments. What we are trying is a kind of failover mechanism and trying to restore the client with the previous state when it crashes. The parent process is effectively a daemon here that keeps track of the child, which is the actual server. I was not in a position to deploy a parallel second child(server) due to some inherent constraints. The child is not stateless and maintains references of the connected clients. If you want to know more details let me know.
Thanks for the replies. Will update you all as soon as I reach the next level.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2005 09:40 PM
03-03-2005 09:40 PM