Changeset 1389:de90cf7f381e in freeDiameter for freeDiameterd
- Timestamp:
- Oct 15, 2019, 11:26:23 PM (4 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
freeDiameterd/main.c
r1339 r1389 46 46 #include <syslog.h> 47 47 #include <stdarg.h> 48 #include <stdlib.h> 49 #include <unistd.h> 48 50 49 51 /* forward declarations */ … … 53 55 54 56 static char *conffile = NULL; 57 static int daemon_mode = 0; 55 58 static int gnutls_debug = 0; 56 59 … … 108 111 } 109 112 113 if (daemon_mode) { 114 TRACE_DEBUG(INFO, "entering background mode"); 115 CHECK_POSIX_DO( daemon(1, 0), goto error ); 116 } 117 110 118 /* Initialize the core library */ 111 119 ret = fd_core_initialize(); … … 170 178 " used for Authentication, Authorization, and Accounting (AAA).\n"); 171 179 printf("\nUsage: " FD_PROJECT_BINARY " [OPTIONS]...\n"); 172 printf( " -h, --help Print help and exit\n" 173 " -V, --version Print version and exit\n" 174 " -c, --config=filename Read configuration from this file instead of the \n" 175 " default location (" DEFAULT_CONF_PATH "/" FD_DEFAULT_CONF_FILENAME ").\n" 180 printf( " -h, --help Print help and exit\n" 181 " -V, --version Print version and exit\n" 182 " -c, --config=filename Read configuration from this file instead of the \n" 183 " default location (" DEFAULT_CONF_PATH "/" FD_DEFAULT_CONF_FILENAME ")\n" 184 " -D, --daemon Start program in background\n" 176 185 " -s, --syslog Write log output to syslog (instead of stdout)\n"); 177 186 printf( "\nDebug:\n" 178 187 " These options are mostly useful for developers\n" 179 " -l, --dbglocale Set the locale for error messages\n"180 188 " -d, --debug Increase verbosity of debug messages if default logger is used\n" 181 " - q, --quiet Decrease verbosity if default logger is used\n"189 " --dbg_gnutls <int> Enable GNU TLS debug at level <int>\n" 182 190 " -f, --dbg_func <func> Enable all traces within the function <func>\n" 183 191 " -F, --dbg_file <file.c> Enable all traces within the file <file.c> (basename match)\n" 184 " --dbg_gnutls <int> Enable GNU TLS debug at level <int>\n" 192 " -l, --dbglocale Set the locale for error messages\n" 193 " -q, --quiet Decrease verbosity if default logger is used\n" 185 194 ); 186 195 } … … 198 207 { "config", required_argument, NULL, 'c' }, 199 208 { "syslog", no_argument, NULL, 's' }, 209 { "daemon", no_argument, NULL, 'D' }, 200 210 { "debug", no_argument, NULL, 'd' }, 201 211 { "quiet", no_argument, NULL, 'q' }, … … 209 219 /* Loop on arguments */ 210 220 while (1) { 211 c = getopt_long (argc, argv, "hVc: dql:f:F:g:s", long_options, &option_index);221 c = getopt_long (argc, argv, "hVc:Ddql:f:F:g:s", long_options, &option_index); 212 222 if (c == -1) 213 223 break; /* Exit from the loop. */ … … 228 238 } 229 239 conffile = optarg; 240 break; 241 242 case 'D': 243 daemon_mode = 1; 230 244 break; 231 245
Note: See TracChangeset
for help on using the changeset viewer.