starter: Added --nolog option to suppress logging in starter itself
authorTobias Brunner <tobias@strongswan.org>
Wed, 12 Sep 2012 15:11:54 +0000 (17:11 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 12 Sep 2012 15:15:14 +0000 (17:15 +0200)
Fixes #224.

src/starter/starter.c

index 166be3e..c6efcb2 100644 (file)
@@ -327,8 +327,8 @@ static bool check_pid(char *pid_file)
 
 static void usage(char *name)
 {
-       fprintf(stderr, "Usage: starter [--nofork] [--auto-update <sec>] "
-                       "[--debug|--debug-more|--debug-all]\n");
+       fprintf(stderr, "Usage: starter [--nofork] [--auto-update <sec>]\n"
+                       "               [--debug|--debug-more|--debug-all|--nolog]\n");
        exit(LSB_RC_INVALID_ARGUMENT);
 }
 
@@ -372,6 +372,10 @@ int main (int argc, char **argv)
                {
                        current_loglevel = 4;
                }
+               else if (streq(argv[i], "--nolog"))
+               {
+                       current_loglevel = 0;
+               }
                else if (streq(argv[i], "--nofork"))
                {
                        no_fork = TRUE;