Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 487588

Summary: OpenRC: Only print flock() error message when debug is enabled
Product: Gentoo Hosted Projects Reporter: Patrick Lauer <patrick>
Component: OpenRCAssignee: OpenRC Team <openrc>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 481182    
Attachments: 0001-convert-flock-messages-to-verbose-warnings.patch

Description Patrick Lauer gentoo-dev 2013-10-11 02:52:40 UTC
Don't print flock error message unless debug is set.
It clutters up parallel startup and makes it look like something critical failed when it's just a mostly cosmetic output parallelism issue

diff --git a/src/rc/runscript.c b/src/rc/runscript.c
index 0eea335..51f58e7 100644
--- a/src/rc/runscript.c
+++ b/src/rc/runscript.c
@@ -313,7 +313,9 @@ write_prefix(const char *buffer, size_t bytes, bool *prefixed)
        if (lock_fd != -1) {
                while (flock(lock_fd, LOCK_EX) != 0) {
                        if (errno != EINTR) {
+                               #ifdef RC_DEBUG
                                eerror("flock() failed: %s", strerror(errno));
+                               #endif
                                break;
                        }
                }
Comment 1 William Hubbs gentoo-dev 2013-10-11 18:03:24 UTC
Created attachment 360660 [details, diff]
0001-convert-flock-messages-to-verbose-warnings.patch

What do you think about this alternative -- converting these messages to
warnings which are only displayed if EINFO_VERBOSE is set to yes in the
environment?
Comment 2 William Hubbs gentoo-dev 2013-10-12 15:02:57 UTC
This is applied in commit f751e14 and will be included in OpenRC-0.13.