1 |
commit: ec65f181eab6289101a0c0df624c9b022f3742d0 |
2 |
Author: Christian Ruppert <idl0r <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Dec 29 01:45:04 2011 +0000 |
4 |
Commit: Christian Ruppert <idl0r <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Dec 29 01:50:24 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=ec65f181 |
7 |
|
8 |
Don't print error when the logfile isn't writeable during shutdown |
9 |
|
10 |
The logfile or its basedir may be read-only during shutdown because the |
11 |
directory may be umounted or read-only remounted already. In this case we simply |
12 |
skip this error. |
13 |
This is related to a comment in bug 390645 but the initial bug is not fixed |
14 |
through this commit. |
15 |
|
16 |
X-Gentoo-Bug: 390645 |
17 |
X-Gentoo-Bug-URL: https://bugs.gentoo.org/390645 |
18 |
|
19 |
--- |
20 |
src/rc/rc-logger.c | 10 ++++++++-- |
21 |
1 files changed, 8 insertions(+), 2 deletions(-) |
22 |
|
23 |
diff --git a/src/rc/rc-logger.c b/src/rc/rc-logger.c |
24 |
index 52c39f0..8f3b218 100644 |
25 |
--- a/src/rc/rc-logger.c |
26 |
+++ b/src/rc/rc-logger.c |
27 |
@@ -276,8 +276,14 @@ rc_logger_open(const char *level) |
28 |
fclose(log); |
29 |
fclose(plog); |
30 |
} else { |
31 |
- log_error = 1; |
32 |
- eerror("Error: fopen(%s) failed: %s", logfile, strerror(errno)); |
33 |
+ /* |
34 |
+ * logfile or its basedir may be read-only during shutdown so skip |
35 |
+ * the error in this case |
36 |
+ */ |
37 |
+ if (strcmp(rc_runlevel_get(), "shutdown") != 0) { |
38 |
+ log_error = 1; |
39 |
+ eerror("Error: fopen(%s) failed: %s", logfile, strerror(errno)); |
40 |
+ } |
41 |
} |
42 |
|
43 |
/* Try to keep the temporary log in case of errors */ |