shared/log: read /proc/cmdline only in daemons

http://lists.freedesktop.org/archives/systemd-devel/2015-February/027960.html
(cherry picked from commit ee46e55570)

Conflicts:
	src/shared/log.c
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2015-03-23 01:54:10 -04:00
parent b4b97da010
commit 4d97551673
+5 -1
View File
@@ -910,7 +910,11 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
void log_parse_environment(void) {
const char *e;
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)