From 77dd01d3edd378b34a27861783cb52f2c1ef38cc Mon Sep 17 00:00:00 2001 From: marschap Date: Tue, 19 Sep 2006 08:26:22 +0000 Subject: [PATCH] make option -f not take arguments in the server --- docs/LCDd.8.in | 13 +++++++------ docs/lcdproc.1.in | 4 +--- scripts/init-LCDd.debian.in | 2 +- server/main.c | 10 ++-------- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/docs/LCDd.8.in b/docs/LCDd.8.in index 3d8061c..02d1a1e 100644 --- a/docs/LCDd.8.in +++ b/docs/LCDd.8.in @@ -5,10 +5,9 @@ LCDd - LCDproc server daemon .SH SYNOPSIS .B LCDd -[\fB\-h\fP] +[\fB\-hf\fP] [\fB\-c\fP \fIconfig\fP] [\fB\-d\fP \fIdriver\fP] -[\fB\-f\fP \fIbool\fP] [\fB\-i\fP \fIbool\fP] [\fB\-a\fP \fIaddr\fP] [\fB\-p\fP \fIport\fP] @@ -44,9 +43,11 @@ Use a configuration file other than @SYSCONFDIR@/LCDd.conf Specify a driver to use (output only to first), overriding the \fBDriver\fP parameter in the config file's \fB[Server]\fP section. .TP -.B \-f \fIbool\fp -Tell whether to run in the foreground (\fI1\fP) or background (\fI0\fP), -overriding the \fBForeground\fP parameter in the config file's \fB[Server]\fP section. +.B \-f +Run LCDd in foreground, overriding the \fBForeground\fP parameter +in the config file's \fB[Server]\fP section. +The default, if not in the config file or without a config file, is to +daemonize \fBLCDd\fP as it is intended to operate in the background. .TP .B \-i \fIbool\fP Tell whether the to enable (\fI1\fP) or disable (\fI0\fP) showing the LCDproc @@ -437,7 +438,7 @@ If LCDd seems not to work as expected, try to run it with reporting level set to reporting to stderr and running it in the foreground. This can be achieved without changes to the config file by using the following command line: .RS -.I LCDd -f 1 -r 5 -s 0 +.I LCDd -f -r 5 -s 0 .RE .SH FILES diff --git a/docs/lcdproc.1.in b/docs/lcdproc.1.in index 14b4e2c..a248f5e 100644 --- a/docs/lcdproc.1.in +++ b/docs/lcdproc.1.in @@ -5,13 +5,11 @@ lcdproc - system status information client .SH SYNOPSIS .B lcdproc +[\fB\-hfv\fP] [\fB\-c\fP \fIconfig\fP] [\fB\-s\fP \fIhost\fP] [\fB\-p\fP \fIport\fP] [\fB\-e\fP \fIdelay\fP] -[\fB\-f\fP] -[\fB\-h\fP] -[\fB\-v\fP] [\fIscreen\fP ...] .SH DESCRIPTION diff --git a/scripts/init-LCDd.debian.in b/scripts/init-LCDd.debian.in index 47a6fbe..982646a 100644 --- a/scripts/init-LCDd.debian.in +++ b/scripts/init-LCDd.debian.in @@ -28,7 +28,7 @@ test -x ${LCDd} || exit 0 case "$1" in start) printf "Starting $DESC:" - start-stop-daemon --start --quiet --background --exec ${LCDd} -- -s -f -c ${configfile} + start-stop-daemon --start --quiet --background --exec ${LCDd} -- -c ${configfile} printf " LCDd" printf ".\n" ;; diff --git a/server/main.c b/server/main.c index b2c2002..1abe4f7 100644 --- a/server/main.c +++ b/server/main.c @@ -301,7 +301,7 @@ process_command_line(int argc, char **argv) /* Analyze options here.. (please try to keep list of options the * same everywhere) */ - while ((c = getopt(argc, argv, "hc:d:f:a:p:u:w:s:r:i:" )) > 0) { + while ((c = getopt(argc, argv, "hc:d:fa:p:u:w:s:r:i:" )) > 0) { switch(c) { case 'h': help = 1; /* Continue to process the other @@ -328,13 +328,7 @@ process_command_line(int argc, char **argv) } break; case 'f': - b = interpret_boolean_arg( optarg ); - if( b == -1 ) { - report( RPT_ERR, "Not a boolean value: '%s'", optarg ); - e = -1; - } else { - foreground_mode = b; - } + foreground_mode = 1; break; case 'a': strncpy(bind_addr, optarg, sizeof(bind_addr));