daemon/main.cc
changeset 2 b3afb9f1e801
parent 0 6f7a81934006
equal deleted inserted replaced
1:30113bfbe723 2:b3afb9f1e801
    20 #include <stdlib.h>
    20 #include <stdlib.h>
    21 #include <sys/types.h>
    21 #include <sys/types.h>
    22 #include <sys/stat.h>
    22 #include <sys/stat.h>
    23 #include <signal.h>
    23 #include <signal.h>
    24 #include <unistd.h>
    24 #include <unistd.h>
    25 #include "cli/cli.h"
    25 #include "cli++/cli++.h"
    26 #include "daemon.h"
    26 #include "daemon.h"
    27 
    27 
    28 const char* cli_program = "vmailmgrd";
    28 const char* cli_program = "vmailmgrd";
    29 const char* cli_help_prefix = "vmailmgr support daemon\n";
    29 const char* cli_help_prefix = "vmailmgr support daemon\n";
    30 const char* cli_help_suffix = "";
    30 const char* cli_help_suffix = "";
    32 const int cli_args_min = 0;
    32 const int cli_args_min = 0;
    33 const int cli_args_max = 0;
    33 const int cli_args_max = 0;
    34 int opt_log_all = true;
    34 int opt_log_all = true;
    35 int opt_verbose = false;
    35 int opt_verbose = false;
    36 
    36 
    37 // This program is the local server that controls the operation of many
    37 // This program is the local server that is used to handle managing
    38 // parts of this package.
    38 // virtual domains from a web or remote interface.
    39 // It is currently used to handle password checking and virtual user
       
    40 // lookups, but will eventually contain the functionality to handle adding
       
    41 // and deleting users and aliases, and changing passwords.
       
    42 //
    39 //
    43 // F<vmailmgrd> logs its activity to standard output, and as such
    40 // F<vmailmgrd> logs its activity to standard output, and as such
    44 // requires its output to be piped through a tool to
    41 // requires its output to be piped through a tool to record those
    45 // record those logs, such as F<accustamp> and F<cyclog> (from the
    42 // logs, such as F<multilog> (from the F<daemontools> package).
    46 // F<daemontools> package), or
       
    47 // F<splogger> (included with the F<qmail> package).
       
    48 
    43 
    49 cli_option cli_options[] = {
    44 cli_option cli_options[] = {
    50   { 'd', 0, cli_option::flag, 0, &opt_log_all,
    45   { 'd', 0, cli_option::flag, 0, &opt_log_all,
    51     "Log only requests that fail", 0 },
    46     "Log only requests that fail", 0 },
    52   { 'D', 0, cli_option::flag, 1, &opt_log_all,
    47   { 'D', 0, cli_option::flag, 1, &opt_log_all,