BIN = nsjail
LIBS = kafel/libkafel.a
-SRCS_CXX = caps.cc cgroup.cc cmdline.cc config.cc contain.cc cpu.cc log.cc mnt.cc net.cc nsjail.cc pid.cc sandbox.cc subproc.cc uts.cc user.cc util.cc
+SRCS_CXX = caps.cc cgroup.cc cmdline.cc config.cc contain.cc cpu.cc logs.cc mnt.cc net.cc nsjail.cc pid.cc sandbox.cc subproc.cc uts.cc user.cc util.cc
SRCS_PROTO = config.proto
SRCS_PB_CXX = $(SRCS_PROTO:.proto=.pb.cc)
SRCS_PB_H = $(SRCS_PROTO:.proto=.pb.h)
# DO NOT DELETE THIS LINE -- make depend depends on it.
-caps.o: caps.h nsjail.h log.h macros.h util.h
-cgroup.o: cgroup.h nsjail.h log.h util.h
-cmdline.o: cmdline.h nsjail.h caps.h config.h log.h macros.h mnt.h sandbox.h
+caps.o: caps.h nsjail.h logs.h macros.h util.h
+cgroup.o: cgroup.h nsjail.h logs.h util.h
+cmdline.o: cmdline.h nsjail.h logs.h caps.h config.h macros.h mnt.h sandbox.h
cmdline.o: user.h util.h
-config.o: caps.h nsjail.h cmdline.h config.h config.pb.h log.h macros.h mnt.h
-config.o: user.h util.h
-contain.o: contain.h nsjail.h caps.h cgroup.h cpu.h log.h mnt.h net.h pid.h
+config.o: caps.h nsjail.h logs.h cmdline.h config.h config.pb.h macros.h
+config.o: mnt.h user.h util.h
+contain.o: contain.h nsjail.h logs.h caps.h cgroup.h cpu.h mnt.h net.h pid.h
contain.o: user.h uts.h
-cpu.o: cpu.h nsjail.h log.h util.h
-log.o: log.h nsjail.h
-mnt.o: mnt.h nsjail.h log.h macros.h subproc.h util.h
-net.o: net.h nsjail.h log.h subproc.h
-nsjail.o: nsjail.h cmdline.h log.h macros.h net.h subproc.h util.h
-pid.o: pid.h nsjail.h log.h subproc.h
-sandbox.o: sandbox.h nsjail.h kafel/include/kafel.h log.h
-subproc.o: subproc.h nsjail.h cgroup.h contain.h log.h macros.h net.h
+cpu.o: cpu.h nsjail.h logs.h util.h
+logs.o: logs.h nsjail.h
+mnt.o: mnt.h nsjail.h logs.h macros.h subproc.h util.h
+net.o: net.h nsjail.h logs.h subproc.h
+nsjail.o: nsjail.h logs.h cmdline.h macros.h net.h subproc.h util.h
+pid.o: pid.h nsjail.h logs.h subproc.h
+sandbox.o: sandbox.h nsjail.h logs.h kafel/include/kafel.h
+subproc.o: subproc.h nsjail.h logs.h cgroup.h contain.h macros.h net.h
subproc.o: sandbox.h user.h util.h
-uts.o: uts.h nsjail.h log.h
-user.o: user.h nsjail.h log.h macros.h subproc.h util.h
-util.o: util.h nsjail.h log.h macros.h
+uts.o: uts.h nsjail.h logs.h
+user.o: user.h nsjail.h logs.h macros.h subproc.h util.h
+util.o: util.h nsjail.h logs.h macros.h
config.pb.o: config.pb.h
#include <sys/types.h>
#include <unistd.h>
-#include "log.h"
+#include "logs.h"
#include "macros.h"
#include "util.h"
#include <sys/stat.h>
#include <unistd.h>
-#include "log.h"
+#include "logs.h"
#include "util.h"
namespace cgroup {
#include "caps.h"
#include "config.h"
-#include "log.h"
+#include "logs.h"
#include "macros.h"
#include "mnt.h"
#include "sandbox.h"
namespace cmdline {
+#define _LOG_DEFAULT_FILE "/var/log/nsjail.log"
+
struct custom_option {
struct option opt;
const char* descr;
nsjconf->cwd = "/";
nsjconf->port = 0;
nsjconf->bindhost = "::";
- nsjconf->log_fd = STDERR_FILENO;
- nsjconf->loglevel = INFO;
+ nsjconf->loglevel = logs::INFO;
nsjconf->daemonize = false;
nsjconf->tlimit = 0;
nsjconf->max_cpus = 0;
break;
case 'l':
nsjconf->logfile = optarg;
- if (!log::initLogFile(nsjconf.get())) {
- return nullptr;
- }
break;
case 'L':
- nsjconf->log_fd = strtol(optarg, NULL, 0);
- if (log::initLogFile(nsjconf.get()) == false) {
- return nullptr;
- }
+ nsjconf->logfile = "/dev/fd/" + std::to_string(strtol(optarg, NULL, 0));
break;
case 'd':
nsjconf->daemonize = true;
break;
case 'v':
- nsjconf->loglevel = DEBUG;
- if (log::initLogFile(nsjconf.get()) == false) {
- return nullptr;
- }
+ nsjconf->loglevel = logs::DEBUG;
break;
case 'q':
- nsjconf->loglevel = WARNING;
- if (log::initLogFile(nsjconf.get()) == false) {
- return nullptr;
- }
+ nsjconf->loglevel = logs::WARNING;
break;
case 'Q':
- nsjconf->loglevel = FATAL;
- if (log::initLogFile(nsjconf.get()) == false) {
- return nullptr;
- }
+ nsjconf->loglevel = logs::FATAL;
break;
case 'e':
nsjconf->keep_env = true;
}
}
+ if (nsjconf->daemonize && nsjconf->logfile.empty()) {
+ nsjconf->logfile = _LOG_DEFAULT_FILE;
+ }
+ if (!logs::initLog(nsjconf->logfile, nsjconf->loglevel)) {
+ return nullptr;
+ }
+
if (nsjconf->mount_proc) {
if (!mnt::addMountPtTail(nsjconf.get(), /* src= */ NULL, nsjconf->proc_path, "proc",
"", nsjconf->is_proc_rw ? 0 : MS_RDONLY, /* isDir= */ mnt::NS_DIR_YES,
nsjconf->gids.push_back(gid);
}
- if (log::initLogFile(nsjconf.get()) == false) {
- return nullptr;
- }
-
if (argv[optind]) {
nsjconf->argv = (const char**)&argv[optind];
}
#include "cmdline.h"
#include "config.h"
#include "config.pb.h"
-#include "log.h"
+#include "logs.h"
#include "macros.h"
#include "mnt.h"
#include "user.h"
nsjconf->daemonize = njc.daemon();
if (njc.has_log_fd()) {
- nsjconf->log_fd = njc.log_fd();
+ nsjconf->logfile = "/dev/fd/" + std::to_string(njc.log_fd());
}
if (njc.has_log_file()) {
nsjconf->logfile = njc.log_file();
if (njc.has_log_level()) {
switch (njc.log_level()) {
case nsjail::LogLevel::DEBUG:
- nsjconf->loglevel = DEBUG;
+ nsjconf->loglevel = logs::DEBUG;
break;
case nsjail::LogLevel::INFO:
- nsjconf->loglevel = INFO;
+ nsjconf->loglevel = logs::INFO;
break;
case nsjail::LogLevel::WARNING:
- nsjconf->loglevel = WARNING;
+ nsjconf->loglevel = logs::WARNING;
break;
case nsjail::LogLevel::ERROR:
- nsjconf->loglevel = ERROR;
+ nsjconf->loglevel = logs::ERROR;
break;
case nsjail::LogLevel::FATAL:
- nsjconf->loglevel = FATAL;
+ nsjconf->loglevel = logs::FATAL;
break;
default:
LOG_E("Unknown log_level: %d", njc.log_level());
}
}
- if (njc.has_log_fd() || njc.has_log_file() || njc.has_log_level()) {
- if (log::initLogFile(nsjconf) == false) {
- return false;
- }
- }
-
nsjconf->keep_env = njc.keep_env();
for (ssize_t i = 0; i < njc.envar_size(); i++) {
nsjconf->envs.push_back(njc.envar(i));
#include "caps.h"
#include "cgroup.h"
#include "cpu.h"
-#include "log.h"
+#include "logs.h"
#include "mnt.h"
#include "net.h"
#include "pid.h"
#include <string.h>
#include <unistd.h>
-#include "log.h"
+#include "logs.h"
#include "util.h"
namespace cpu {
+++ /dev/null
-/*
-
- nsjail - logging
- -----------------------------------------
-
- Copyright 2014 Google Inc. All Rights Reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-*/
-
-#include "log.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <getopt.h>
-#include <limits.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/syscall.h>
-#include <sys/types.h>
-#include <time.h>
-#include <unistd.h>
-
-#include "nsjail.h"
-
-namespace log {
-
-static int log_fd = STDERR_FILENO;
-static bool log_fd_isatty = true;
-static enum llevel_t log_level = INFO;
-
-#define _LOG_DEFAULT_FILE "/var/log/nsjail.log"
-
-__attribute__((constructor)) static void log_init(void) { log_fd_isatty = isatty(log_fd); }
-
-/*
- * Log to stderr by default. Use a dup()d fd, because in the future we'll associate the
- * connection socket with fd (0, 1, 2).
- */
-bool initLogFile(nsjconf_t* nsjconf) {
- /* Close previous log_fd */
- if (log_fd > STDERR_FILENO) {
- close(log_fd);
- log_fd = STDERR_FILENO;
- }
- log_fd = nsjconf->log_fd;
- log_level = nsjconf->loglevel;
-
- if (nsjconf->logfile.empty() && nsjconf->daemonize) {
- nsjconf->logfile = _LOG_DEFAULT_FILE;
- }
- if (nsjconf->logfile.empty()) {
- log_fd = fcntl(log_fd, F_DUPFD_CLOEXEC, 0);
- } else {
- if (TEMP_FAILURE_RETRY(log_fd = open(nsjconf->logfile.c_str(),
- O_CREAT | O_RDWR | O_APPEND | O_CLOEXEC, 0640)) == -1) {
- log_fd = STDERR_FILENO;
- PLOG_E("Couldn't open logfile open('%s')", nsjconf->logfile.c_str());
- return false;
- }
- }
- log_fd_isatty = (isatty(log_fd) == 1 ? true : false);
- return true;
-}
-
-void logMsg(enum llevel_t ll, const char* fn, int ln, bool perr, const char* fmt, ...) {
- if (ll < log_level) {
- return;
- }
-
- char strerr[512];
- if (perr) {
- snprintf(strerr, sizeof(strerr), "%s", strerror(errno));
- }
- struct ll_t {
- const char* const descr;
- const char* const prefix;
- const bool print_funcline;
- const bool print_time;
- };
- static struct ll_t const logLevels[] = {
- {"D", "\033[0;4m", true, true},
- {"I", "\033[1m", false, true},
- {"W", "\033[0;33m", true, true},
- {"E", "\033[1;31m", true, true},
- {"F", "\033[7;35m", true, true},
- {"HR", "\033[0m", false, false},
- {"HB", "\033[1m", false, false},
- };
-
- time_t ltstamp = time(NULL);
- struct tm utctime;
- localtime_r(<stamp, &utctime);
- char timestr[32];
- if (strftime(timestr, sizeof(timestr) - 1, "%FT%T%z", &utctime) == 0) {
- timestr[0] = '\0';
- }
-
- /* Start printing logs */
- if (log_fd_isatty) {
- dprintf(log_fd, "%s", logLevels[ll].prefix);
- }
- if (logLevels[ll].print_time) {
- dprintf(log_fd, "[%s] ", timestr);
- }
- if (logLevels[ll].print_funcline) {
- dprintf(log_fd, "[%s][%d] %s():%d ", logLevels[ll].descr, (int)getpid(), fn, ln);
- }
-
- va_list args;
- va_start(args, fmt);
- vdprintf(log_fd, fmt, args);
- va_end(args);
- if (perr) {
- dprintf(log_fd, ": %s", strerr);
- }
- if (log_fd_isatty) {
- dprintf(log_fd, "\033[0m");
- }
- dprintf(log_fd, "\n");
- /* End printing logs */
-
- if (ll == FATAL) {
- exit(0xff);
- }
-}
-
-void logStop(int sig) { LOG_I("Server stops due to fatal signal (%d) caught. Exiting", sig); }
-
-} // namespace log
+++ /dev/null
-/*
-
- nsjail - logging
- -----------------------------------------
-
- Copyright 2014 Google Inc. All Rights Reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-*/
-
-#ifndef NS_LOG_H
-#define NS_LOG_H
-
-#include <getopt.h>
-#include <stdbool.h>
-
-#include "nsjail.h"
-
-#define LOG_HELP(...) log::logMsg(HELP, __PRETTY_FUNCTION__, __LINE__, false, __VA_ARGS__);
-#define LOG_HELP_BOLD(...) \
- log::logMsg(HELP_BOLD, __PRETTY_FUNCTION__, __LINE__, false, __VA_ARGS__);
-
-#define LOG_D(...) log::logMsg(DEBUG, __PRETTY_FUNCTION__, __LINE__, false, __VA_ARGS__);
-#define LOG_I(...) log::logMsg(INFO, __PRETTY_FUNCTION__, __LINE__, false, __VA_ARGS__);
-#define LOG_W(...) log::logMsg(WARNING, __PRETTY_FUNCTION__, __LINE__, false, __VA_ARGS__);
-#define LOG_E(...) log::logMsg(ERROR, __PRETTY_FUNCTION__, __LINE__, false, __VA_ARGS__);
-#define LOG_F(...) log::logMsg(FATAL, __PRETTY_FUNCTION__, __LINE__, false, __VA_ARGS__);
-
-#define PLOG_D(...) log::logMsg(DEBUG, __PRETTY_FUNCTION__, __LINE__, true, __VA_ARGS__);
-#define PLOG_I(...) log::logMsg(INFO, __PRETTY_FUNCTION__, __LINE__, true, __VA_ARGS__);
-#define PLOG_W(...) log::logMsg(WARNING, __PRETTY_FUNCTION__, __LINE__, true, __VA_ARGS__);
-#define PLOG_E(...) log::logMsg(ERROR, __PRETTY_FUNCTION__, __LINE__, true, __VA_ARGS__);
-#define PLOG_F(...) log::logMsg(FATAL, __PRETTY_FUNCTION__, __LINE__, true, __VA_ARGS__);
-
-namespace log {
-
-bool initLogFile(nsjconf_t* nsjconf);
-void logMsg(enum llevel_t ll, const char* fn, int ln, bool perr, const char* fmt, ...)
- __attribute__((format(printf, 5, 6)));
-void logStop(int sig);
-
-} // namespace log
-
-#endif /* NS_LOG_H */
--- /dev/null
+/*
+
+ nsjail - logging
+ -----------------------------------------
+
+ Copyright 2014 Google Inc. All Rights Reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+*/
+
+#include "logs.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <getopt.h>
+#include <limits.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/syscall.h>
+#include <sys/types.h>
+#include <time.h>
+#include <unistd.h>
+
+#include "nsjail.h"
+
+#include <string.h>
+
+namespace logs {
+
+static int log_fd = STDERR_FILENO;
+static bool log_fd_isatty = true;
+static enum llevel_t log_level = INFO;
+
+__attribute__((constructor)) static void log_init(void) { log_fd_isatty = isatty(log_fd); }
+
+/*
+ * Log to stderr by default. Use a dup()d fd, because in the future we'll associate the
+ * connection socket with fd (0, 1, 2).
+ */
+bool initLog(const std::string& logfile, llevel_t level) {
+ /* Close previous log_fd */
+ if (log_fd > STDERR_FILENO) {
+ close(log_fd);
+ log_fd = STDERR_FILENO;
+ }
+ log_level = level;
+ if (logfile.empty()) {
+ log_fd = fcntl(log_fd, F_DUPFD_CLOEXEC, 0);
+ } else {
+ if (TEMP_FAILURE_RETRY(log_fd = open(logfile.c_str(),
+ O_CREAT | O_RDWR | O_APPEND | O_CLOEXEC, 0640)) == -1) {
+ log_fd = STDERR_FILENO;
+ log_fd_isatty = (isatty(log_fd) == 1 ? true : false);
+ PLOG_E("Couldn't open logfile open('%s')", logfile.c_str());
+ return false;
+ }
+ }
+ log_fd_isatty = (isatty(log_fd) == 1 ? true : false);
+ return true;
+}
+
+void logMsg(enum llevel_t ll, const char* fn, int ln, bool perr, const char* fmt, ...) {
+ if (ll < log_level) {
+ return;
+ }
+
+ char strerr[512];
+ if (perr) {
+ snprintf(strerr, sizeof(strerr), "%s", strerror(errno));
+ }
+ struct ll_t {
+ const char* const descr;
+ const char* const prefix;
+ const bool print_funcline;
+ const bool print_time;
+ };
+ static struct ll_t const logLevels[] = {
+ {"D", "\033[0;4m", true, true},
+ {"I", "\033[1m", false, true},
+ {"W", "\033[0;33m", true, true},
+ {"E", "\033[1;31m", true, true},
+ {"F", "\033[7;35m", true, true},
+ {"HR", "\033[0m", false, false},
+ {"HB", "\033[1m", false, false},
+ };
+
+ time_t ltstamp = time(NULL);
+ struct tm utctime;
+ localtime_r(<stamp, &utctime);
+ char timestr[32];
+ if (strftime(timestr, sizeof(timestr) - 1, "%FT%T%z", &utctime) == 0) {
+ timestr[0] = '\0';
+ }
+
+ /* Start printing logs */
+ if (log_fd_isatty) {
+ dprintf(log_fd, "%s", logLevels[ll].prefix);
+ }
+ if (logLevels[ll].print_time) {
+ dprintf(log_fd, "[%s] ", timestr);
+ }
+ if (logLevels[ll].print_funcline) {
+ dprintf(log_fd, "[%s][%d] %s():%d ", logLevels[ll].descr, (int)getpid(), fn, ln);
+ }
+
+ va_list args;
+ va_start(args, fmt);
+ vdprintf(log_fd, fmt, args);
+ va_end(args);
+ if (perr) {
+ dprintf(log_fd, ": %s", strerr);
+ }
+ if (log_fd_isatty) {
+ dprintf(log_fd, "\033[0m");
+ }
+ dprintf(log_fd, "\n");
+ /* End printing logs */
+
+ if (ll == FATAL) {
+ exit(0xff);
+ }
+}
+
+void logStop(int sig) { LOG_I("Server stops due to fatal signal (%d) caught. Exiting", sig); }
+
+} // namespace logs
--- /dev/null
+/*
+
+ nsjail - logging
+ -----------------------------------------
+
+ Copyright 2014 Google Inc. All Rights Reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+*/
+
+#ifndef NS_LOGS_H
+#define NS_LOGS_H
+
+#include <getopt.h>
+#include <stdbool.h>
+
+#include <string>
+
+namespace logs {
+
+#define LOG_HELP(...) logs::logMsg(logs::HELP, __PRETTY_FUNCTION__, __LINE__, false, __VA_ARGS__);
+#define LOG_HELP_BOLD(...) \
+ logs::logMsg(logs::HELP_BOLD, __PRETTY_FUNCTION__, __LINE__, false, __VA_ARGS__);
+
+#define LOG_D(...) logs::logMsg(logs::DEBUG, __PRETTY_FUNCTION__, __LINE__, false, __VA_ARGS__);
+#define LOG_I(...) logs::logMsg(logs::INFO, __PRETTY_FUNCTION__, __LINE__, false, __VA_ARGS__);
+#define LOG_W(...) logs::logMsg(logs::WARNING, __PRETTY_FUNCTION__, __LINE__, false, __VA_ARGS__);
+#define LOG_E(...) logs::logMsg(logs::ERROR, __PRETTY_FUNCTION__, __LINE__, false, __VA_ARGS__);
+#define LOG_F(...) logs::logMsg(logs::FATAL, __PRETTY_FUNCTION__, __LINE__, false, __VA_ARGS__);
+
+#define PLOG_D(...) logs::logMsg(logs::DEBUG, __PRETTY_FUNCTION__, __LINE__, true, __VA_ARGS__);
+#define PLOG_I(...) logs::logMsg(logs::INFO, __PRETTY_FUNCTION__, __LINE__, true, __VA_ARGS__);
+#define PLOG_W(...) logs::logMsg(logs::WARNING, __PRETTY_FUNCTION__, __LINE__, true, __VA_ARGS__);
+#define PLOG_E(...) logs::logMsg(logs::ERROR, __PRETTY_FUNCTION__, __LINE__, true, __VA_ARGS__);
+#define PLOG_F(...) logs::logMsg(logs::FATAL, __PRETTY_FUNCTION__, __LINE__, true, __VA_ARGS__);
+
+enum llevel_t {
+ DEBUG = 0,
+ INFO,
+ WARNING,
+ ERROR,
+ FATAL,
+ HELP,
+ HELP_BOLD,
+};
+
+bool initLog(const std::string& logfile, llevel_t loglevel);
+void logMsg(enum llevel_t ll, const char* fn, int ln, bool perr, const char* fmt, ...)
+ __attribute__((format(printf, 5, 6)));
+void logStop(int sig);
+
+} // namespace logs
+
+#endif /* NS_LOGS_H */
#include <syscall.h>
#include <unistd.h>
-#include "log.h"
+#include "logs.h"
#include "macros.h"
#include "subproc.h"
#include "util.h"
#include <sys/types.h>
#include <unistd.h>
-#include "log.h"
+#include "logs.h"
#include "subproc.h"
extern char** environ;
#include <unistd.h>
#include "cmdline.h"
-#include "log.h"
+#include "logs.h"
#include "macros.h"
#include "net.h"
#include "subproc.h"
for (;;) {
if (nsjailSigFatal > 0) {
subproc::killAll(nsjconf);
- log::logStop(nsjailSigFatal);
+ logs::logStop(nsjailSigFatal);
close(listenfd);
return;
}
}
if (nsjailSigFatal > 0) {
subproc::killAll(nsjconf);
- log::logStop(nsjailSigFatal);
+ logs::logStop(nsjailSigFatal);
return -1;
}
#include <string>
#include <vector>
+#include "logs.h"
+
static const int nssigs[] = {
SIGINT,
SIGQUIT,
MODE_STANDALONE_RERUN
};
-enum llevel_t {
- DEBUG = 0,
- INFO,
- WARNING,
- ERROR,
- FATAL,
- HELP,
- HELP_BOLD,
-};
-
struct nsjconf_t {
const char* exec_file;
bool use_execveat;
std::string chroot;
int port;
const char* bindhost;
- int log_fd;
std::string logfile;
- enum llevel_t loglevel;
+ logs::llevel_t loglevel;
bool daemonize;
time_t tlimit;
size_t max_cpus;
#include <sys/prctl.h>
#include <unistd.h>
-#include "log.h"
+#include "logs.h"
#include "subproc.h"
namespace pid {
extern "C" {
#include "kafel.h"
}
-#include "log.h"
+#include "logs.h"
namespace sandbox {
#include "cgroup.h"
#include "contain.h"
-#include "log.h"
+#include "logs.h"
#include "macros.h"
#include "net.h"
#include "sandbox.h"
#include <sys/types.h>
#include <unistd.h>
-#include "log.h"
+#include "logs.h"
#include "macros.h"
#include "subproc.h"
#include "util.h"
#include <time.h>
#include <unistd.h>
-#include "log.h"
+#include "logs.h"
#include "macros.h"
namespace util {
#include <string.h>
#include <unistd.h>
-#include "log.h"
+#include "logs.h"
namespace uts {