2 * support/include/ha-callout.h
4 * High Availability NFS Callout support routines
6 * Copyright (c) 2004, Paul Clements, SteelEye Technology
8 * In order to implement HA NFS, we need several callouts at key
9 * points in statd and mountd. These callouts all come to ha_callout(),
10 * which, in turn, calls out to an ha-callout script (not part of nfs-utils;
11 * defined by -H argument to rpc.statd and rpc.mountd).
18 extern char *ha_callout_prog;
21 ha_callout(char *event, char *arg1, char *arg2, int arg3)
23 char buf[16]; /* should be plenty */
27 if (!ha_callout_prog) /* HA callout is not enabled */
30 sprintf(buf, "%d", arg3);
34 case 0: execl(ha_callout_prog, ha_callout_prog,
36 arg3 < 0 ? NULL : buf,
40 case -1: perror("fork");
42 default: ret = waitpid(pid, NULL, 0);
46 dprintf(N_DEBUG, "ha callout returned %d\n", WEXITSTATUS(ret));
48 xlog(D_GENERAL, "ha callout returned %d\n", WEXITSTATUS(ret));