summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKerin Millar <kfm@plushkava.net>2024-08-01 00:20:10 +0100
committerKerin Millar <kfm@plushkava.net>2024-08-01 00:36:10 +0100
commitd6e689bc832e4b033f4af9cb6746a99649ecc8d8 (patch)
tree79a0c9cdd185fd12afe86064277d386d66e9e5f7
parentAdd a comment regarding POSIX XCU compatibility (diff)
downloadgentoo-functions-d6e689bc832e4b033f4af9cb6746a99649ecc8d8.tar.gz
gentoo-functions-d6e689bc832e4b033f4af9cb6746a99649ecc8d8.tar.bz2
gentoo-functions-d6e689bc832e4b033f4af9cb6746a99649ecc8d8.zip
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@plushkava.net>
-rw-r--r--functions/rc.sh8
1 files 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=$*