36 #include "cmdhandler.h"
39 #include "clientpipe.h"
58 "start Starts the engine and the process. \n"
59 "running Returns acknowledgment that the engine is running.\n"
60 "reload Reload the engine.\n"
61 "stop Stop the engine and terminate the process.\n\n"
66 handles(
const char *cmd)
68 if (ods_check_command(cmd,
"stop"))
return 1;
69 if (ods_check_command(cmd,
"reload"))
return 1;
70 if (ods_check_command(cmd,
"running"))
return 1;
71 if (ods_check_command(cmd,
"start"))
return 1;
77 run(
int sockfd, cmdhandler_ctx_type* context,
const char *cmd)
80 if (ods_check_command(cmd,
"start")) {
81 ods_log_debug(
"[cmdhandler] start command");
82 client_printf(sockfd,
"Engine already running.\n");
85 }
else if (ods_check_command(cmd,
"running")) {
86 ods_log_debug(
"[cmdhandler] running command");
87 client_printf(sockfd,
"Engine running.\n");
89 }
else if (ods_check_command(cmd,
"reload")) {
90 ods_log_debug(
"[cmdhandler] reload command");
91 ods_log_assert(engine);
96 client_printf(sockfd,
"Reloading engine.\n");
98 }
else if (ods_check_command(cmd,
"stop")) {
99 ods_log_debug(
"[cmdhandler] stop command");
100 ods_log_assert(engine);
105 client_printf(sockfd,
"%s\n", ODS_SE_STOP_RESPONSE);
113 "ctrl", &usage, &help, &handles, &run