aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rc/rc-logger.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rc/rc-logger.c b/src/rc/rc-logger.c
index 52c39f0f..8f3b218c 100644
--- a/src/rc/rc-logger.c
+++ b/src/rc/rc-logger.c
@@ -276,8 +276,14 @@ rc_logger_open(const char *level)
fclose(log);
fclose(plog);
} else {
- log_error = 1;
- eerror("Error: fopen(%s) failed: %s", logfile, strerror(errno));
+ /*
+ * logfile or its basedir may be read-only during shutdown so skip
+ * the error in this case
+ */
+ if (strcmp(rc_runlevel_get(), "shutdown") != 0) {
+ log_error = 1;
+ eerror("Error: fopen(%s) failed: %s", logfile, strerror(errno));
+ }
}
/* Try to keep the temporary log in case of errors */