From cfb34bfebe1316d0c9b1c9e8ca3118b3968a6f28 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Thu, 5 Dec 2013 18:39:03 +0100 Subject: [PATCH] sysdbd: Changed -d option to -D and default to daemonizing the process. It doesn't really matter much what the default is but -d should be reserved for debugging. --- doc/sysdbd.1.txt | 7 ++++--- src/daemon/sysdbd.c | 10 +++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/sysdbd.1.txt b/doc/sysdbd.1.txt index 019ad97..ae6ec18 100644 --- a/doc/sysdbd.1.txt +++ b/doc/sysdbd.1.txt @@ -32,9 +32,10 @@ OPTIONS The main configuration file. This file defines the behavior of *sysdbd* by specifying default settings and the plugins to be loaded. -*-d*:: - Daemonize on startup: Start *sysdbd* as a background process detached from - the current terminal and session. +*-D*:: + Do not daemonize on startup: Rather than starting *sysdbd* as a background + process detached from the current terminal and session (the default), run + the process in the foreground. This allows easy monitoring of *sysdbd*. *-h*:: Display a usage and help summary and exit. diff --git a/src/daemon/sysdbd.c b/src/daemon/sysdbd.c index 2f2afa2..16cac49 100644 --- a/src/daemon/sysdbd.c +++ b/src/daemon/sysdbd.c @@ -89,7 +89,7 @@ exit_usage(char *name, int status) "\nOptions:\n" " -C FILE the main configuration file\n" " default: "CONFIGFILE"\n" -" -d run in background (daemonize)\n" +" -D do not run in background (daemonize)\n" "\n" " -h display this help and exit\n" " -V display the version number and copyright\n" @@ -178,7 +178,7 @@ int main(int argc, char **argv) { char *config_filename = NULL; - _Bool do_daemonize = 0; + _Bool do_daemonize = 1; pthread_t backend_thread; @@ -186,7 +186,7 @@ main(int argc, char **argv) int status; while (42) { - int opt = getopt(argc, argv, "C:dhV"); + int opt = getopt(argc, argv, "C:DhV"); if (-1 == opt) break; @@ -195,8 +195,8 @@ main(int argc, char **argv) case 'C': config_filename = optarg; break; - case 'd': - do_daemonize = 1; + case 'D': + do_daemonize = 0; break; case 'h': -- 2.30.2