commit:     d6e689bc832e4b033f4af9cb6746a99649ecc8d8
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Wed Jul 31 23:20:10 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jul 31 23:36:10 2024 +0000
URL:        
https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=d6e689bc

Treat EINFO_LOG as false if equal to RC_SERVICE

Consider the value of EINFO_LOG to be false in the event that it is
equal to the value of RC_SERVICE. The reason for this is that, as of the
time of writing, openrc-run(8) defines and uses EINFO_LOG in a way that
is at odds with gentoo-functions. Ideally, the behaviour of OpenRC would
be modified so that it becomes possible to jettison this workaround.

Fixes: 0dd8364c03c6f8737150ee4f146ddeeec57efee9
Bug: https://bugs.gentoo.org/936613
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>

 functions/rc.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/functions/rc.sh b/functions/rc.sh
index 9129b32..9b1fc5d 100644
--- a/functions/rc.sh
+++ b/functions/rc.sh
@@ -117,7 +117,11 @@ eoutdent()
 #
 # Invokes the logger(1) utility, provided that EINFO_LOG is true. The first
 # parameter shall be taken as a priority level, the second as the message tag,
-# and the remaining parameters as the message to be logged.
+# and the remaining parameters as the message to be logged. As a special case,
+# the value of EINFO_LOG shall be treated as if were false in the event that it
+# is equal to the value of RC_SERVICE. The reason for this is that, as of the
+# time of writing, openrc-run(8) defines and uses EINFO_LOG in a way that is
+# at odds with gentoo-functions.
 #
 esyslog()
 {
@@ -126,7 +130,7 @@ esyslog()
        if [ "$#" -lt 2 ]; then
                warn "esyslog: too few arguments (got $#, expected at least 2)"
                return 1
-       elif yesno "${EINFO_LOG}" && hash logger 2>/dev/null; then
+       elif [ "${EINFO_LOG}" != "${RC_SERVICE}" ] && yesno "${EINFO_LOG}"; then
                pri=$1 tag=$2
                shift 2
                msg=$*

Reply via email to