It's something about going into the default runlevel I think, the file exists on the first fopen but then cannot be opened for reading:
* Error: fopen(/run/openrc/rc.log) failed: No such file or directory ae1=1 ae2=0 ae3=1 level=default
diff -ura orig-openrc-0.40.3/src/rc/rc-logger.c new-openrc-0.40.3/src/rc/rc-logger.c
--- orig-openrc-0.40.3/src/rc/rc-logger.c 2018-12-21 18:24:18.000000000 +0000
+++ new-openrc-0.40.3/src/rc/rc-logger.c 2019-02-18 17:58:34.099205658 +0000
@@ -148,6 +148,11 @@
const char *logfile;
int log_error = 0;
+ int fopae1 = 0;
+ int fopae2 = 0;
+ int fopae3 = 0;
+
+
if (!rc_conf_yesno("rc_logger"))
return;
@@ -184,13 +189,15 @@
signal_pipe[1] = -1;
runlevel = level;
- if ((log = fopen(TMPLOG, "ae")))
+ if ((log = fopen(TMPLOG, "ae"))) {
write_time(log, "started");
- else {
+ fopae1 = 1;
+ } else {
free(logbuf);
logbuf_size = BUFSIZ * 10;
logbuf = xmalloc(sizeof (char) * logbuf_size);
logbuf_len = 0;
+ fopae1 = 9;
}
fd[0].fd = signal_pipe[0];
@@ -237,6 +244,9 @@
if ((log = fopen(TMPLOG, "ae"))) {
write_time(log, "started");
write_log(fileno(log), logbuf, logbuf_len);
+ fopae2 = 1;
+ } else {
+ fopae2 = 9;
}
free(logbuf);
}
@@ -255,6 +265,7 @@
}
if ((plog = fopen(logfile, "ae"))) {
+ fopae3 = 1;
if ((log = fopen(TMPLOG, "re"))) {
while ((bytes = fread(buffer, sizeof(*buffer), BUFSIZ, log)) > 0) {
if (fwrite(buffer, sizeof(*buffer), bytes, plog) < bytes) {
@@ -266,7 +277,7 @@
fclose(log);
} else {
log_error = 1;
- eerror("Error: fopen(%s) failed: %s", TMPLOG, strerror(errno));
+ eerror("Error: fopen(%s) failed: %s ae1=%d ae2=%d ae3=%d level=%s", TMPLOG, strerror(errno), fopae1, fopae2, fopae3, level);
}
fclose(plog);