summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-08-16 22:39:02 +0200
committerLennart Poettering <lennart@poettering.net>2010-08-16 22:39:02 +0200
commit2396fb04f78eaa9842c747e384218f0069446960 (patch)
tree73b2b579e628e84b7c4f13446dd8096b7a3bd32d /src
parent618e02c7b7f8e11fdb954a019342d745937baf55 (diff)
log: properly open log target in the various utilities
Diffstat (limited to 'src')
-rw-r--r--src/cgls.c1
-rw-r--r--src/cgroups-agent.c1
-rw-r--r--src/initctl.c1
-rw-r--r--src/log.c6
-rw-r--r--src/logger.c1
-rw-r--r--src/notify.c1
-rw-r--r--src/random-seed.c2
-rw-r--r--src/shutdownd.c1
-rw-r--r--src/systemctl.c1
-rw-r--r--src/update-utmp.c1
10 files changed, 13 insertions, 3 deletions
diff --git a/src/cgls.c b/src/cgls.c
index c60f9eecce..2940e3724b 100644
--- a/src/cgls.c
+++ b/src/cgls.c
@@ -75,6 +75,7 @@ int main(int argc, char *argv[]) {
int r = 0, retval = 1;
log_parse_environment();
+ log_open();
if ((r = parse_argv(argc, argv)) < 0)
goto finish;
diff --git a/src/cgroups-agent.c b/src/cgroups-agent.c
index ed1d43e7d4..92b56c5fbd 100644
--- a/src/cgroups-agent.c
+++ b/src/cgroups-agent.c
@@ -39,6 +39,7 @@ int main(int argc, char *argv[]) {
log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
log_parse_environment();
+ log_open();
/* If possible we go via the system bus, to make sure that
* session instances get the messages. If not possible we talk
diff --git a/src/initctl.c b/src/initctl.c
index e1ab3f7e49..115452e86b 100644
--- a/src/initctl.c
+++ b/src/initctl.c
@@ -349,6 +349,7 @@ int main(int argc, char *argv[]) {
log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
log_parse_environment();
+ log_open();
if ((n = sd_listen_fds(true)) < 0) {
log_error("Failed to read listening file descriptors from environment: %s", strerror(-r));
diff --git a/src/log.c b/src/log.c
index 8c20b9c9de..d6f4e34613 100644
--- a/src/log.c
+++ b/src/log.c
@@ -73,7 +73,7 @@ static int log_open_console(void) {
return console_fd;
}
- log_info("Succesfully opened /dev/console for logging.");
+ log_debug("Succesfully opened /dev/console for logging.");
} else
console_fd = STDERR_FILENO;
@@ -99,7 +99,7 @@ static int log_open_kmsg(void) {
return -errno;
}
- log_info("Succesfully opened /dev/kmsg for logging.");
+ log_debug("Succesfully opened /dev/kmsg for logging.");
return 0;
}
@@ -146,7 +146,7 @@ static int log_open_syslog(void) {
goto fail;
}
- log_info("Succesfully opened syslog for logging.");
+ log_debug("Succesfully opened syslog for logging.");
return 0;
diff --git a/src/logger.c b/src/logger.c
index 26bf888f24..64ac21404a 100644
--- a/src/logger.c
+++ b/src/logger.c
@@ -547,6 +547,7 @@ int main(int argc, char *argv[]) {
log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
log_parse_environment();
+ log_open();
if ((n = sd_listen_fds(true)) < 0) {
log_error("Failed to read listening file descriptors from environment: %s", strerror(-r));
diff --git a/src/notify.c b/src/notify.c
index b914a74420..1c18c6bc08 100644
--- a/src/notify.c
+++ b/src/notify.c
@@ -134,6 +134,7 @@ int main(int argc, char* argv[]) {
int r, retval = 1;
log_parse_environment();
+ log_open();
if ((r = parse_argv(argc, argv)) <= 0) {
retval = r < 0;
diff --git a/src/random-seed.c b/src/random-seed.c
index 91aa6c6b4e..b9cafb7cd7 100644
--- a/src/random-seed.c
+++ b/src/random-seed.c
@@ -39,7 +39,9 @@ int main(int argc, char *argv[]) {
return 1;
}
+ log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
log_parse_environment();
+ log_open();
/* When we load the seed we read it and write it to the device
* and then immediately update the saved seed with new data,
diff --git a/src/shutdownd.c b/src/shutdownd.c
index d889824536..80ff2e9fba 100644
--- a/src/shutdownd.c
+++ b/src/shutdownd.c
@@ -192,6 +192,7 @@ int main(int argc, char *argv[]) {
log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
log_parse_environment();
+ log_open();
if ((n_fds = sd_listen_fds(true)) < 0) {
log_error("Failed to read listening file descriptors from environment: %s", strerror(-r));
diff --git a/src/systemctl.c b/src/systemctl.c
index a3186db4a0..50473a182a 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -4903,6 +4903,7 @@ int main(int argc, char*argv[]) {
dbus_error_init(&error);
log_parse_environment();
+ log_open();
if ((r = parse_argv(argc, argv)) < 0)
goto finish;
diff --git a/src/update-utmp.c b/src/update-utmp.c
index b5d733ca44..5a48bd98dd 100644
--- a/src/update-utmp.c
+++ b/src/update-utmp.c
@@ -368,6 +368,7 @@ int main(int argc, char *argv[]) {
log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
log_parse_environment();
+ log_open();
#ifdef HAVE_AUDIT
if ((c.audit_fd = audit_open()) < 0)