fixes by M. Dolze: typos in lcdproc.conf, init reporting, harmonize daemonizing

This commit is contained in:
marschap
2006-04-24 11:18:25 +00:00
parent ff0cb79b17
commit b9632af264
2 changed files with 32 additions and 23 deletions
+19 -19
View File
@@ -14,8 +14,8 @@ ReportLevel=2
# report to to syslog ?
ReportToSyslog=false
# stay in foreground ?
Foreground=false
# Run in background (Default: true)
#Daemonize=true
# slow down initial announcement of modes (in 1/100s)
#delay=2
@@ -25,61 +25,61 @@ Foreground=false
[CPU]
# Show screen
Active = True
OnTime = 1
OffTime = 2
ShowInvisible = false
Active=True
OnTime=1
OffTime=2
ShowInvisible=false
[Memory]
# Show screen
Active = True
Active=True
[Load]
# Show screen
Active = True
Active=True
[TimeDate]
# Show screen
Active = True
Active=True
[About]
# Show screen
Active = false
Active=false
[SMP-CPU]
# Show screen
Active = false
Active=false
[OldTime]
# Show screen
Active = false
Active=false
[BigClock]
# Show screen
Active = false
Active=false
[Uptime]
# Show screen
Active = false
Active=false
[Battery]
# Show screen
Active = false
Active=false
[CPUGraph]
# Show screen
Active = false
Active=false
[ProcSize]
# Show screen
Active = false
Active=false
[Disk]
# Show screen
Active = false
Active=false
[MiniClock]
# Show screen
Active = True
Active=True
# EOF
+13 -4
View File
@@ -73,7 +73,8 @@ static int process_configfile(char *cfgfile);
#define UNSET_STR "\01"
#define DEFAULT_SERVER "127.0.0.1"
#define DEFAULT_CONFIGFILE SYSCONFDIR "/lcdproc.conf"
#define DEFAULT_REPORTDEST RPT_DEST_STDERR
#define DEFAULT_REPORTLEVEL RPT_WARNING
/* list of modes to run */
mode sequence[] =
@@ -104,7 +105,7 @@ static int islow = -1;
char * progname = "lcdproc";
char * server = NULL;
int port = LCDPORT;
int daemonize = FALSE;
int daemonize = UNSET_INT;
static int report_level = UNSET_INT;
static int report_dest = UNSET_INT;
char configfile[256]; /* a lot of space in the executable. */
@@ -159,7 +160,6 @@ void clear_modes()
int
main(int argc, char **argv)
{
int daemonize = FALSE;
int error = 0;
/* get uname information */
@@ -184,6 +184,15 @@ main(int argc, char **argv)
if (strcmp(configfile, UNSET_STR) != 0)
CHAIN( error, process_configfile(configfile) );
/* Set default options */
if (report_dest == UNSET_INT )
report_dest = DEFAULT_REPORTDEST;
if( report_level == UNSET_INT )
report_level = DEFAULT_REPORTLEVEL;
/* Set reporting settings */
set_reporting("lcdproc", report_level, report_dest);
CHAIN_END( error, "Error in config file or command line\n" );
if (server == NULL)
@@ -333,7 +342,7 @@ process_configfile(char *configfile)
}
}
if (daemonize == UNSET_INT) {
daemonize = config_get_bool(progname, "Foreground", 0, 1);
daemonize = config_get_bool(progname, "Daemonize", 0, 1);
}
if (islow < 0) {
islow = config_get_int(progname, "delay", 0, -1);