Shiv Nagarajan(deleted)
|
Re: HAM - ham_action_notify_pulse
|
Shiv Nagarajan(deleted)
03/04/2010 10:05 AM
post48797
|
Re: HAM - ham_action_notify_pulse
can you run the ham with additional verbosity (ham -vvvvv) and then look
at the ham logs to see if the action is being triggerred. You should be
able to see the process die, and also the ham action being triggerred.
If the action is being triggered you should verify that the trigger of
the pulse contains the appropriate values as you would expect (pid, chid
etc)
thanks
shiv
Thu Mar 4 10:11:49 EST 2010
--> According to Wim Hellenthal <--
I have a process that attaches itself to the HAM using ham_attach_self (name, 0, 0,0,0 );
When this process dies I would like a notification to be send to a server process that is capable of handling pulses.
I can retrieve the server information like pid and chid using the ConnectServerInfo call. like this
int coid = name_open (server, 0);
if ( coid == -1 )
return;
/* Retrieve server information - we need the channel id */
if ( ConnectServerInfo(0, coid, &info) < 0 )
return;
name_close(coid);
This work. What I do next is register the condition and action like this:
hc[0] = ham_condition(he, CONDDEATH, "death-condition", 0);
if ( hc[0] )
{
ha[0] = 0;
ha[0] = ham_action_notify_pulse(hc[0], "death-action-pulse",
ND_LOCAL_NODE, info.pid, info.chid,
HA_PULSE_DEATH, 0,
HREARMAFTERRESTART);
return(0);
}
running the process will show all the information under the /proc/ham directory but killing it will not show a
notification within the specified server. Am i doing something wrong here?
Regards
Wim
_______________________________________________
OSTech
http://community.qnx.com/sf/go/post48767
--
****
Shiv Nagarajan,
Kernel Developer, QNX Software Systems,
Ottawa, Canada
****
|
|
|
Wim Hellenthal
|
Re: HAM - ham_action_notify_pulse
|
Wim Hellenthal
03/04/2010 3:04 PM
post48837
|
Re: HAM - ham_action_notify_pulse
Hi Shiv
Thanks for the suggestion. I'm a bit confused I have a small test program making use of the code already posted: The
code is in the file attached. When I stop the program by entering the return key no pulse is created and send the server
. When I kill the program entering Ctrl-C then a pulse is send. Why is there a difference in behaviour?
Another question is the following:
Is it possible to add heartbeat conditions and actions when a program is already attached to the HAM by the
ham_attach_self (name, 0, 0,0,0 ); routine. Or use the ham_attach_self routine with the heartbeat parameters but
temporary disable conditions and action related to heartbeat handling?
Thanks for the help!
Regards Wim
|
|
|