Data Structures | Functions
daemon.h File Reference

The daemon consists of global settings and a number of workers. More...

#include "util/locks.h"
#include "util/alloc.h"
#include "services/modstack.h"

Data Structures

struct  daemon
 Structure holding worker list. More...


struct daemondaemon_init (void)
 Initialize daemon structure. More...
int daemon_open_shared_ports (struct daemon *daemon)
 Open shared listening ports (if needed). More...
void daemon_fork (struct daemon *daemon)
 Fork workers and start service. More...
void daemon_cleanup (struct daemon *daemon)
 Close off the worker thread information. More...
void daemon_delete (struct daemon *daemon)
 Delete workers, close listening ports. More...
void daemon_apply_cfg (struct daemon *daemon, struct config_file *cfg)
 Apply config settings. More...

Detailed Description

The daemon consists of global settings and a number of workers.

Function Documentation

struct daemon* daemon_init ( void  )
int daemon_open_shared_ports ( struct daemon daemon)

Open shared listening ports (if needed).

The cfg member pointer must have been set for the daemon.

daemon,:the daemon.
: false on error.

References daemon::cfg, config_file::control_port, daemon_remote_open_ports(), daemon::listening_port, listening_ports_free(), listening_ports_open(), log_assert, daemon::num_ports, config_file::num_threads, config_file::port, daemon::ports, daemon::rc_port, daemon::rc_ports, config_file::remote_control_enable, and config_file::so_reuseport.

Referenced by run_daemon(), and service_init().

void daemon_fork ( struct daemon daemon)
void daemon_cleanup ( struct daemon daemon)

Close off the worker thread information.

Bring the daemon back into state ready for daemon_fork again.

daemon,:the daemon.

References daemon::cfg, daemon_remote_clear(), daemon::env, daemon::local_zones, local_zones_delete(), log_assert, log_thread_set(), module_env::msg_cache, daemon::num, daemon::rc, module_env::rrset_cache, signal_handling_record(), slabhash_clear(), rrset_cache::table, worker_delete(), and daemon::workers.

Referenced by run_daemon(), service_deinit(), and service_main().

void daemon_delete ( struct daemon daemon)
void daemon_apply_cfg ( struct daemon daemon,
struct config_file cfg