Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 401115 - sys-apps/openrc-0.9.8.2 with read-only base filesystem prints unnecessary warning in single runlevel
Summary: sys-apps/openrc-0.9.8.2 with read-only base filesystem prints unnecessary war...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 399185
  Show dependency tree
 
Reported: 2012-01-28 00:15 UTC by Maxim Kammerer
Modified: 2012-02-09 10:18 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim Kammerer 2012-01-28 00:15:35 UTC
In src/rc/rc-logger.c:

    /*
     * logfile or its basedir may be read-only during sysinit and
     * shutdown so skip the error in this case
     */
    if ((strcmp(level, RC_LEVEL_SHUTDOWN) != 0) && (strcmp(level, RC_LEVEL_SYSINIT) != 0)) {
        log_error = 1;
        eerror("Error: fopen(%s) failed: %s", logfile, strerror(errno));
    }

However, what about telinit 1? I have /var mounted by localmount from /etc/fstab (i.e., not initramfs), and I am seeing two warnings after telinit 1:

    * Error: fopen(/var/log/rc.log) failed: Read-only file system
    * Warning: temporary logfile left behind: /lib/rc/init.d/rc.log

Suggest including RC_LEVEL_SINGLE in the comparison above, and/or reworking the logic to check errno against EROFS, e.g.:

    if ((errno != EROFS) || (strcmp(level, RC_LEVEL_SHUTDOWN) != 0) && (strcmp(level, RC_LEVEL_SYSINIT) != 0) && (strcmp(level, RC_LEVEL_SINGLE) != 0)) {
Comment 1 Christian Ruppert (idl0r) gentoo-dev 2012-01-28 18:06:46 UTC
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commitdiff;h=2d2751c

Should be fixed in Git.
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-02-09 09:42:20 UTC
@Maxim: have you tested the fixes?
I think we can probably close this since it's in master.
Comment 3 Maxim Kammerer 2012-02-09 10:15:33 UTC
(In reply to comment #2)
> @Maxim: have you tested the fixes?

Didn't test, but they look fine to me - ro-fs errors are ignored at any runlevel. That's more encompassing than what I suggested, but you know the intended policy better.
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-02-09 10:18:38 UTC
Ok, closing this then.