39 #include <libxml/parser.h>
43 #define AUTHOR_NAME "Matthijs Mekking"
44 #define COPYRIGHT_STR "Copyright (C) 2008-2010 NLnet Labs OpenDNSSEC"
54 fprintf(out,
"Usage: %s [OPTIONS]\n",
"ods-signerd");
55 fprintf(out,
"Start the OpenDNSSEC signer engine daemon.\n\n");
56 fprintf(out,
"Supported options:\n");
57 fprintf(out,
" -c | --config <cfgfile> Read configuration from file.\n");
58 fprintf(out,
" -d | --no-daemon Do not daemonize the signer "
60 fprintf(out,
" -1 | --single-run Run once, then exit.\n");
61 fprintf(out,
" -h | --help Show this help and exit.\n");
62 fprintf(out,
" -i | --info Print configuration and exit.\n");
63 fprintf(out,
" -v | --verbose Increase verbosity.\n");
64 fprintf(out,
" -V | --version Show version and exit.\n");
65 fprintf(out,
"\nBSD licensed, see LICENSE in source package for "
67 fprintf(out,
"Version %s. Report bugs to <%s>.\n",
68 PACKAGE_VERSION, PACKAGE_BUGREPORT);
79 fprintf(out,
"%s version %s\n", PACKAGE_NAME, PACKAGE_VERSION);
82 fprintf(out,
"See source files for more license information\n");
87 program_setup(
const char* cfgfile,
int cmdline_verbosity)
89 const char* file = NULL;
94 ods_log_verbose(
"[engine] starting signer");
122 int options_index = 0;
125 int cmdline_verbosity = 0;
126 char *time_arg = NULL;
127 const char* cfgfile = ODS_SE_CFGFILE;
128 static struct option long_options[] = {
129 {
"config", required_argument, 0,
'c'},
130 {
"no-daemon", no_argument, 0,
'd'},
131 {
"help", no_argument, 0,
'h'},
132 {
"info", no_argument, 0,
'i'},
133 {
"verbose", no_argument, 0,
'v'},
134 {
"version", no_argument, 0,
'V'},
135 {
"set-time", required_argument, 0, 256},
139 if(argv[0][0] !=
'/') {
140 char *path = getcwd(NULL,0);
141 asprintf(&argv0,
"%s/%s", path, argv[0]);
144 argv0 = strdup(argv[0]);
148 while ((c=getopt_long(argc, argv,
"c:dhivV",
149 long_options, &options_index)) != -1) {
188 if(set_time_now_str(time_arg)) {
189 fprintf(stderr,
"Error: Failed to interpret start time argument. Daemon not started.\n");
195 fprintf(stdout,
"OpenDNSSEC signer engine version %s\n", PACKAGE_VERSION);
197 ods_janitor_initialize(argv0);
198 program_setup(cfgfile, cmdline_verbosity);
199 returncode =
engine_start(cfgfile, cmdline_verbosity, daemonize, info);