#include <haproxy/api-t.h>
#include <haproxy/global-t.h>
+#include <haproxy/cfgparse.h>
extern struct global global;
extern int pid; /* current process id */
extern const char *old_unixsocket;
extern int daemon_fd[2];
extern int devnullfd;
+extern int fileless_mode;
+extern struct cfgfile fileless_cfg;
struct proxy;
struct server;
int pidfd = -1; /* FD to keep PID */
int daemon_fd[2] = {-1, -1}; /* pipe to communicate with parent process */
int devnullfd = -1;
+int fileless_mode;
+struct cfgfile fileless_cfg;
static int stopped_tgroups;
static int stop_detected;
if (backup_env() != 0)
exit(EXIT_FAILURE);
- /* parse conf in discovery mode and set modes from config */
- read_cfg_in_discovery_mode(argc, argv);
+ if (!fileless_mode)
+ /* parse conf in discovery mode and set modes from config */
+ read_cfg_in_discovery_mode(argc, argv);
+ else {
+ int ret;
+
+ ret = parse_cfg(&fileless_cfg);
+ if (ret != 0)
+ exit(EXIT_FAILURE);
+ }
/* From this stage all runtime modes are known. So let's do below some
* preparation steps and then let's apply all discovered modes.
mworker_apply_master_worker_mode();
}
- /* Worker, daemon, foreground modes read the rest of the config */
- if (!master) {
+ /* Worker, daemon, foreground, configuration with files modes read the rest
+ * of the config.
+ */
+ if (!master && !fileless_mode) {
usermsgs_clr("config");
if (global.mode & MODE_MWORKER) {
if (clean_env() != 0) {