IBR-DTNSuite
0.12
|
#include "config.h"
#include "Configuration.h"
#include <ibrcommon/Logger.h>
#include <ibrcommon/data/File.h>
#include <ibrcommon/thread/SignalHandler.h>
#include <libdaemon/daemon.h>
#include <string.h>
#include <set>
#include <sys/types.h>
#include <unistd.h>
#include <syslog.h>
#include <pwd.h>
#include "NativeDaemon.h"
Go to the source code of this file.
Functions | |
void | func_sighandler (int signal) |
int | __daemon_run () |
int | main (int argc, char *argv[]) |
Variables | |
dtn::daemon::NativeDaemon | _dtnd |
unsigned char | logopts = ibrcommon::Logger::LOG_DATETIME | ibrcommon::Logger::LOG_LEVEL | ibrcommon::Logger::LOG_TAG |
const unsigned char | logerr = ibrcommon::Logger::LOGGER_ERR | ibrcommon::Logger::LOGGER_CRIT |
const unsigned char | logstd = ibrcommon::Logger::LOGGER_ALL ^ (ibrcommon::Logger::LOGGER_DEBUG | ibrcommon::Logger::LOGGER_NOTICE | logerr) |
const unsigned char | logsys = ibrcommon::Logger::LOGGER_ALL ^ (ibrcommon::Logger::LOGGER_DEBUG | ibrcommon::Logger::LOGGER_NOTICE) |
bool | _debug = false |
ibrcommon::Conditional | _shutdown_cond |
bool | _shutdown = false |
int __daemon_run | ( | ) |
Definition at line 112 of file Main.cpp.
References _debug, _shutdown, ibrcommon::Logger::addStream(), dtn::daemon::Configuration::Daemon::daemonize(), dtn::daemon::Configuration::Logger::display_timestamps(), ibrcommon::Logger::enableAsync(), ibrcommon::Logger::enableBuffer(), dtn::daemon::Configuration::Debug::enabled(), ibrcommon::Logger::enableSyslog(), func_sighandler(), dtn::daemon::Configuration::getDaemon(), dtn::daemon::Configuration::getDebug(), dtn::daemon::Configuration::getInstance(), dtn::daemon::Configuration::Logger::getLogfile(), dtn::daemon::Configuration::getLogger(), ibrcommon::SignalHandler::handle(), dtn::daemon::NativeDaemon::init(), ibrcommon::SignalHandler::initialize(), dtn::daemon::Configuration::Debug::level(), dtn::daemon::Configuration::load(), ibrcommon::Logger::LOG_DATETIME, ibrcommon::Logger::LOG_TIMESTAMP, logerr, ibrcommon::Logger::LOGGER_ALL, ibrcommon::Logger::LOGGER_DEBUG, ibrcommon::Logger::LOGGER_NOTICE, logopts, logstd, logsys, dtn::daemon::Configuration::Debug::quiet(), dtn::daemon::RUNLEVEL_ROUTING_EXTENSIONS, dtn::daemon::RUNLEVEL_ZERO, ibrcommon::Logger::setDefaultTag(), ibrcommon::Logger::setLogfile(), ibrcommon::Logger::setVerbosity(), ibrcommon::Logger::stop(), dtn::daemon::Configuration::Logger::verbose(), and ibrcommon::Conditional::wait().
Referenced by main().
void func_sighandler | ( | int | signal) |
Definition at line 74 of file Main.cpp.
References _debug, _shutdown, ibrcommon::Logger::addStream(), ibrcommon::Logger::LOGGER_DEBUG, logopts, dtn::daemon::NativeDaemon::reload(), dtn::daemon::NativeDaemon::setDebug(), and ibrcommon::Conditional::signal().
Referenced by __daemon_run().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 213 of file Main.cpp.
References __daemon_run(), dtn::daemon::Configuration::Daemon::daemonize(), dtn::daemon::Configuration::getDaemon(), dtn::daemon::Configuration::getInstance(), ibrcommon::File::getPath(), dtn::daemon::Configuration::Daemon::getPidFile(), dtn::daemon::Configuration::Daemon::kill_daemon(), and dtn::daemon::Configuration::params().
bool _debug = false |
Definition at line 67 of file Main.cpp.
Referenced by __daemon_run(), func_sighandler(), dtn::daemon::Configuration::load(), and dtn::daemon::Configuration::params().
bool _shutdown = false |
Definition at line 71 of file Main.cpp.
Referenced by __daemon_run(), func_sighandler(), ibrdtn_daemon_shutdown(), and ServiceMain().
ibrcommon::Conditional _shutdown_cond |
const unsigned char logerr = ibrcommon::Logger::LOGGER_ERR | ibrcommon::Logger::LOGGER_CRIT |
Definition at line 58 of file Main.cpp.
Referenced by __daemon_run(), and main().
unsigned char logopts = ibrcommon::Logger::LOG_DATETIME | ibrcommon::Logger::LOG_LEVEL | ibrcommon::Logger::LOG_TAG |
setup logging capabilities
Definition at line 55 of file Main.cpp.
Referenced by __daemon_run(), func_sighandler(), main(), and dtn::daemon::NativeDaemon::setLogFile().
const unsigned char logstd = ibrcommon::Logger::LOGGER_ALL ^ (ibrcommon::Logger::LOGGER_DEBUG | ibrcommon::Logger::LOGGER_NOTICE | logerr) |
Definition at line 61 of file Main.cpp.
Referenced by __daemon_run(), and main().
const unsigned char logsys = ibrcommon::Logger::LOGGER_ALL ^ (ibrcommon::Logger::LOGGER_DEBUG | ibrcommon::Logger::LOGGER_NOTICE) |
Definition at line 64 of file Main.cpp.
Referenced by __daemon_run(), main(), dtn::daemon::NativeDaemon::setLogFile(), and dtn::daemon::NativeDaemon::setLogging().