]> git.tuebingen.mpg.de Git - dss.git/commitdiff
Use logfile only for --run --daemon.
authorAndre Noll <maan@systemlinux.org>
Sat, 17 Apr 2010 12:43:00 +0000 (14:43 +0200)
committerAndre Noll <maan@systemlinux.org>
Thu, 17 Jun 2010 20:33:30 +0000 (22:33 +0200)
In all other cases it does not really make sense, so it is
better to write log output to stderr in these cases, even if
--logfile was given.

dss.c
dss.ggo

diff --git a/dss.c b/dss.c
index 531beb60508045a3f40e983b80edc7102a3f4c26..e32e7e20a1efcad97f213b7da6212bb881ccc248 100644 (file)
--- a/dss.c
+++ b/dss.c
@@ -884,7 +884,7 @@ static int parse_config_file(int override)
                        conf.logfile_given = 1;
                }
        }
-       if (conf.logfile_given) {
+       if (conf.logfile_given && conf.run_given && conf.daemon_given) {
                logfile = open_log(conf.logfile_arg);
                log_welcome(conf.loglevel_arg);
        }
diff --git a/dss.ggo b/dss.ggo
index 7934db3faa02a40f7943713202c271df4f98c506..8f1ec5cf8d3ce50194a81f569b8195eb6562a618 100644 (file)
--- a/dss.ggo
+++ b/dss.ggo
@@ -77,9 +77,10 @@ option "logfile" -
 "Logfile for the dss daemon process"
 string typestr="filename"
 optional
-details="
-       This option is mostly useful for the run command if --daemon
-       is also given.
+details = "
+       This option is only honored if both --run and --daemon are
+       given. Otherwise it is silently ignored and log output is
+       written to stderr.
 "
 
 ##################