chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
shared: add formats-util.h
[elogind.git]
/
src
/
shared
/
log.c
diff --git
a/src/shared/log.c
b/src/shared/log.c
index 9c0156026d0a5a7d57b3596fcdae69c2d0dc57cb..32ec581d8d591e5b3bf9637b8505bfd9b0545dd3 100644
(file)
--- a/
src/shared/log.c
+++ b/
src/shared/log.c
@@
-34,6
+34,7
@@
#include "missing.h"
#include "macro.h"
#include "socket-util.h"
#include "missing.h"
#include "macro.h"
#include "socket-util.h"
+#include "formats-util.h"
#define SNDBUF_SIZE (8*1024*1024)
#define SNDBUF_SIZE (8*1024*1024)
@@
-914,7
+915,9
@@
static int parse_proc_cmdline_item(const char *key, const char *value) {
* The systemd.log_xyz= settings are parsed by all tools, and
* so is "debug".
*
* The systemd.log_xyz= settings are parsed by all tools, and
* so is "debug".
*
- * However, "quiet" is only parsed by PID 1!
+ * However, "quiet" is only parsed by PID 1, and only turns of
+ * status output to /dev/console, but does not alter the log
+ * level.
*/
if (streq(key, "debug") && !value)
*/
if (streq(key, "debug") && !value)
@@
-947,7
+950,11
@@
static int parse_proc_cmdline_item(const char *key, const char *value) {
void log_parse_environment(void) {
const char *e;
void log_parse_environment(void) {
const char *e;
- (void) parse_proc_cmdline(parse_proc_cmdline_item);
+ if (get_ctty_devnr(0, NULL) < 0)
+ /* Only try to read the command line in daemons.
+ We assume that anything that has a controlling
+ tty is user stuff. */
+ (void) parse_proc_cmdline(parse_proc_cmdline_item);
e = secure_getenv("SYSTEMD_LOG_TARGET");
if (e && log_set_target_from_string(e) < 0)
e = secure_getenv("SYSTEMD_LOG_TARGET");
if (e && log_set_target_from_string(e) < 0)