OpenDNSSEC-signer
1.4.9
|
#include "config.h"
#include "daemon/cfg.h"
#include "daemon/cmdhandler.h"
#include "daemon/dnshandler.h"
#include "daemon/xfrhandler.h"
#include "daemon/worker.h"
#include "scheduler/fifoq.h"
#include "scheduler/schedule.h"
#include "shared/allocator.h"
#include "shared/locks.h"
#include "signer/zonelist.h"
#include "wire/edns.h"
#include <signal.h>
Go to the source code of this file.
Data Structures | |
struct | engine_struct |
Typedefs | |
typedef struct engine_struct | engine_type |
Functions | |
void | engine_start (const char *cfgfile, int cmdline_verbosity, int daemonize, int info, int single_run) |
void | engine_start_drudgers (engine_type *engine) |
void | engine_stop_drudgers (engine_type *engine) |
void | engine_wakeup_workers (engine_type *engine) |
void | engine_update_zones (engine_type *engine, ods_status zl_changed) |
void | engine_cleanup (engine_type *engine) |
typedef struct engine_struct engine_type |
void engine_cleanup | ( | engine_type * | engine | ) |
Clean up engine.
[in] | engine | engine |
Clean up engine.
Definition at line 1103 of file engine.c.
References engine_struct::allocator, allocator_cleanup(), allocator_deallocate(), engine_struct::cmdhandler, cmdhandler_cleanup(), engine_struct::config, engine_struct::dnshandler, dnshandler_cleanup(), engine_struct::drudgers, engine_config_cleanup(), fifoq_cleanup(), lock_basic_destroy, lock_basic_off, engineconfig_struct::num_signer_threads, engineconfig_struct::num_worker_threads, schedule_cleanup(), engine_struct::signal_cond, engine_struct::signal_lock, engine_struct::signq, engine_struct::taskq, worker_cleanup(), engine_struct::workers, engine_struct::xfrhandler, xfrhandler_cleanup(), engine_struct::zonelist, and zonelist_cleanup().
Referenced by engine_start(), and engine_wakeup_workers().
void engine_start | ( | const char * | cfgfile, |
int | cmdline_verbosity, | ||
int | daemonize, | ||
int | info, | ||
int | single_run | ||
) |
Start engine.
[in] | cfgfile | configuration file |
[in] | cmdline_verbosity | how many -v on the command line |
[in] | daemonize | to run as daemon or not |
[in] | info | print info and exit |
[in] | single_run | run once |
Start engine.
Definition at line 983 of file engine.c.
References engine_struct::allocator, engineconfig_struct::clisock_filename, engine_struct::cmdhandler_done, engine_struct::config, engine_struct::daemonize, engine_cleanup(), engine_config(), engine_config_check(), engine_config_print(), engine_update_zones(), zonelist_struct::just_added, zonelist_struct::just_removed, zonelist_struct::just_updated, lock_basic_lock, lock_basic_unlock, engineconfig_struct::log_filename, engine_struct::need_to_exit, engine_struct::need_to_reload, ods_fatal_exit(), ods_log_assert, ods_log_close(), ods_log_error(), ods_log_info(), ods_log_init(), ods_log_verbose(), ods_status2str(), ODS_STATUS_OK, ODS_STATUS_UNCHANGED, ODS_STATUS_WRITE_PIDFILE_ERR, engine_struct::pid, engineconfig_struct::pid_filename, tsig_handler_cleanup(), engineconfig_struct::use_syslog, util_check_pidfile(), engineconfig_struct::verbosity, zonelist_struct::zl_lock, engine_struct::zonelist, engineconfig_struct::zonelist_filename, and zonelist_update().
Referenced by main().
void engine_start_drudgers | ( | engine_type * | engine | ) |
Start drudgers.
[in] | engine | engine |
Definition at line 389 of file engine.c.
References engine_struct::config, engine_struct::drudgers, worker_struct::engine, worker_struct::need_to_exit, engineconfig_struct::num_signer_threads, engineconfig_struct::num_worker_threads, ods_log_assert, ods_log_debug(), ods_thread_create, ods_thread_join, fifoq_struct::q_lock, fifoq_struct::q_nonfull, engine_struct::signq, worker_struct::thread_id, worker_notify_all(), worker_wakeup(), and engine_struct::workers.
Referenced by engine_wakeup_workers(), and lhsm_check_connection().
void engine_stop_drudgers | ( | engine_type * | engine | ) |
Stop drudgers.
[in] | engine | engine |
Definition at line 426 of file engine.c.
References engine_struct::config, engine_struct::drudgers, worker_struct::engine, worker_struct::need_to_exit, engineconfig_struct::num_signer_threads, ods_log_assert, ods_log_debug(), ods_thread_join, fifoq_struct::q_lock, fifoq_struct::q_threshold, engine_struct::signq, worker_struct::thread_id, and worker_notify_all().
Referenced by engine_wakeup_workers(), and lhsm_check_connection().
void engine_update_zones | ( | engine_type * | engine, |
ods_status | zl_changed | ||
) |
Update zones.
[in] | engine | engine |
[in] | zl_changed | whether the zonelist has changed or not |
Update zones.
Definition at line 788 of file engine.c.
References adapter_load_config(), zone_struct::adinbound, zone_struct::adoutbound, engine_struct::config, zone_struct::db, engine_struct::dnshandler, dnshandler_fwd_notify(), engine_wakeup_workers(), xfrd_struct::handler, lock_basic_lock, lock_basic_unlock, zone_struct::name, xfrhandler_struct::netio, netio_remove_handler(), engineconfig_struct::notify_command, zone_struct::notify_ns, ods_log_assert, ods_log_crit(), ods_log_debug(), ods_log_error(), ods_log_warning(), ODS_SE_NOTIFY_CMD, ods_status2str(), ODS_STATUS_ERR, ODS_STATUS_OK, ODS_STATUS_UNCHANGED, schedule_struct::schedule_lock, schedule_task(), zone_struct::signconf, zone_struct::task, task_cleanup(), task_create(), TASK_SIGNCONF, engine_struct::taskq, time_now(), unschedule_task(), zone_struct::xfrd, engine_struct::xfrhandler, zonelist_struct::zl_lock, zone_struct::zl_status, zone_cleanup(), zone_struct::zone_lock, zone_recover2(), zone_reschedule_task(), ZONE_ZL_ADDED, ZONE_ZL_OK, ZONE_ZL_REMOVED, engine_struct::zonelist, zonelist_del_zone(), and zonelist_struct::zones.
Referenced by engine_start().
void engine_wakeup_workers | ( | engine_type * | engine | ) |
Wake up workers.
[in] | engine | engine |
Wake up all workers.
Definition at line 453 of file engine.c.
References ADAPTER_DNS, ADAPTER_FILE, zone_struct::adinbound, zone_struct::adoutbound, engine_struct::allocator, engineconfig_struct::cfg_filename, engineconfig_struct::clisock_filename, engine_struct::cmdhandler, cmdhandler_create(), engine_struct::config, adapter_struct::configstr, engine_struct::daemonize, zone_struct::db, engine_struct::dnshandler, xfrhandler_struct::dnshandler, dnshandler_create(), dnshandler_listen(), engine_struct::edns, edns_init(), EDNS_MAX_MESSAGE_LEN, engine_cleanup(), engine_start_drudgers(), engine_stop_drudgers(), netio_handler_struct::fd, engine_struct::gid, engineconfig_struct::group, notify_struct::handler, xfrd_struct::handler, engineconfig_struct::interfaces, namedb_struct::is_processed, lhsm_open(), lhsm_reopen(), lock_basic_lock, lock_basic_sleep, lock_basic_unlock, engineconfig_struct::log_filename, zone_struct::name, engine_struct::need_to_exit, engine_struct::need_to_reload, xfrhandler_struct::netio, netio_add_handler(), netio_remove_handler(), zone_struct::notify, zone_struct::notify_args, notify_cleanup(), zone_struct::notify_command, notify_create(), zone_struct::notify_ns, engineconfig_struct::num_worker_threads, ods_chown(), ods_log_assert, ods_log_debug(), ods_log_error(), ods_log_verbose(), ods_log_warning(), ods_replace(), ods_status2str(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_CHDIR_ERR, ODS_STATUS_CMDHANDLER_ERR, ODS_STATUS_FORK_ERR, ODS_STATUS_HSM_ERR, ODS_STATUS_OK, ODS_STATUS_PRIVDROP_ERR, ODS_STATUS_SETSID_ERR, ODS_STATUS_WRITE_PIDFILE_ERR, ODS_STATUS_XFRHANDLER_ERR, ods_str_list_add(), ods_str_trim(), engine_struct::pid, engineconfig_struct::pid_filename, privgid(), privuid(), xfrd_struct::serial_disk_acquired, engine_struct::signal, signal_capture(), engine_struct::signal_cond, signal_handler(), engine_struct::signal_lock, SIGNAL_RELOAD, SIGNAL_RUN, signal_set_engine(), SIGNAL_SHUTDOWN, tsig_handler_init(), adapter_struct::type, engine_struct::uid, engineconfig_struct::use_syslog, engineconfig_struct::username, util_write_pidfile(), worker_wakeup(), engine_struct::workers, engineconfig_struct::working_dir, zone_struct::xfrd, xfrd_cleanup(), xfrd_create(), xfrd_set_timer_now(), dnshandler_struct::xfrhandler, engine_struct::xfrhandler, xfrhandler_create(), engine_struct::zonelist, and zonelist_struct::zones.
Referenced by engine_update_zones(), and xfrd_acl_sockaddr_to().