#define SET_MODE 18
-#define SET_READYFD 19
#define DBUS_CLIENT 20
#define DBUS_SERVICE 21
{DISPLAY_HELP, 0, "help", "Display this help"},
{SET_MODE, 1, "mode", "Set the mode: either local, remote or global"},
- {SET_READYFD, 1, "readyfd", "Set the #fd to signal when ready"},
{DBUS_CLIENT, 1, "dbus-client", "Bind to an afb service through dbus"},
{DBUS_SERVICE, 1, "dbus-server", "Provides an afb service through dbus"},
config->mode = argvalenum(optc, mode_desc);
break;
- case SET_READYFD:
- config->readyfd = argvalintdec(optc, 0, INT_MAX);
- break;
-
case DBUS_CLIENT:
list_add(&config->dbus_clients, argvalstr(optc));
break;
D(httpdPort)
B(background)
- D(readyfd)
D(cacheTimeout)
D(apiTimeout)
D(cntxTimeout)
int httpdPort;
int background; // run in backround mode
- int readyfd; // a #fd to signal when ready to serve
int cacheTimeout;
int apiTimeout;
int cntxTimeout; // Client Session Context timeout
if (execute_command() < 0)
exit(1);
- /* signal that ready */
- if (config->readyfd != 0) {
- static const char readystr[] = "READY=1";
- write(config->readyfd, readystr, sizeof(readystr) - 1);
- close(config->readyfd);
- }
-
// infinite loop
eventloop = afb_common_get_event_loop();
sd_notify(1, "READY=1");