1SAM_HC_CALLBACK_REGCIoSrToEsRy(n3c)Cluster Engine ProgrammerS'AsM_MHaCn_uCaAlLLBACK_REGISTER(3)
2
3
4
6 sam_hc_callback_register - Register health check callback
7
8
10 #include <corosync/sam.h>
11
12
13 cs_error_t sam_hc_callback_register (sam_hc_callback_t cb);
14
15
17 The sam_hc_callback_register function is used to register a user pro‐
18 vided healthcheck callback. After calling of this function, the SAM is
19 switched from application driven healthchecking to event driven
20 healthchecking. In this mode, sam_hc_send(3) does not need to be exe‐
21 cuted.
22
23
24 The parameter cb is callback function of type sam_hc_callback_t defined
25 as:
26
27 typedef int (*sam_hc_callback_t)(void);
28
29
30 This function will be regulargly called and must return 0 if the
31 process is functioning normally, or -1 if the process is executing
32 abnormally. When -1 is returned, the SAM server execute the registered
33 recovery policy.
34
35
36 A value of NULL can be passed into this function to switch into appli‐
37 cation driven healthchecking. cb to NULL.
38
39
41 This call return CS_OK value if successful, otherwise and error is
42 returned.
43
44
46 CS_ERR_BAD_HANDLE
47 SAM was not initialized and registered or health checking is in
48 running state
49
50 CS_ERR_LIBRARY
51 internal library call failed. This can occur during fork() or
52 pipe () system calls and the errno variable can be read to
53 retrieve more information.
54
55
57 sam_start(3), sam_stop(3), sam_hc_send(3), sam_register(3),
58
59
60
61corosync Man Page 12/01/2009 SAM_HC_CALLBACK_REGISTER(3)