38 #include <libxml/parser.h> 41 #define AUTHOR_NAME "Matthijs Mekking" 42 #define COPYRIGHT_STR "Copyright (C) 2008-2010 NLnet Labs OpenDNSSEC" 52 fprintf(out,
"Usage: %s [OPTIONS]\n",
"ods-signerd");
53 fprintf(out,
"Start the OpenDNSSEC signer engine daemon.\n\n");
54 fprintf(out,
"Supported options:\n");
55 fprintf(out,
" -c | --config <cfgfile> Read configuration from file.\n");
56 fprintf(out,
" -d | --no-daemon Do not daemonize the signer " 58 fprintf(out,
" -1 | --single-run Run once, then exit.\n");
59 fprintf(out,
" -h | --help Show this help and exit.\n");
60 fprintf(out,
" -i | --info Print configuration and exit.\n");
61 fprintf(out,
" -v | --verbose Increase verbosity.\n");
62 fprintf(out,
" -V | --version Show version and exit.\n");
63 fprintf(out,
"\nBSD licensed, see LICENSE in source package for " 65 fprintf(out,
"Version %s. Report bugs to <%s>.\n",
66 PACKAGE_VERSION, PACKAGE_BUGREPORT);
77 fprintf(out,
"%s version %s\n", PACKAGE_NAME, PACKAGE_VERSION);
80 fprintf(out,
"See source files for more license information\n");
85 program_setup(
int cmdline_verbosity)
87 ods_log_init(
"ods-signerd", 0, NULL, cmdline_verbosity);
88 ods_log_verbose(
"[engine] starting signer");
115 int options_index = 0;
119 int cmdline_verbosity = 0;
120 char *time_arg = NULL;
121 const char* cfgfile = ODS_SE_CFGFILE;
122 static struct option long_options[] = {
123 {
"single-run", no_argument, 0,
'1'},
124 {
"config", required_argument, 0,
'c'},
125 {
"no-daemon", no_argument, 0,
'd'},
126 {
"help", no_argument, 0,
'h'},
127 {
"info", no_argument, 0,
'i'},
128 {
"verbose", no_argument, 0,
'v'},
129 {
"version", no_argument, 0,
'V'},
130 {
"set-time", required_argument, 0, 256},
135 while ((c=getopt_long(argc, argv,
"1c:dhivV",
136 long_options, &options_index)) != -1) {
178 if(set_time_now_str(time_arg)) {
179 fprintf(stderr,
"Error: Failed to interpret start time argument. Daemon not started.\n");
185 fprintf(stdout,
"OpenDNSSEC signer engine version %s\n", PACKAGE_VERSION);
187 program_setup(cmdline_verbosity);
188 returncode =
engine_start(cfgfile, cmdline_verbosity, daemonize,
int engine_start(const char *cfgfile, int cmdline_verbosity, int daemonize, int info, int single_run)
int main(int argc, char *argv[])