Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.6, 11.8
-
None
-
None
-
RHEL 8 an later, maybe others, too
Description
The current implementation of the sysvinit script only creates log_success_msg() and log_failure_msg() fallback functions when not finding an /etc/init.d/functions file to include.
Newer RHEL releases do not declare those functions in that file anymore though.
So instead of checking for file existence the init script should check for whether the functions are actually declared, and declare the fallbacks if not:
diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh
|
index dd8cbd4850e..18c42ff1473 100644
|
--- a/support-files/mysql.server.sh
|
+++ b/support-files/mysql.server.sh
|
@@ -100,11 +100,18 @@ fi
|
|
if test -f $init_functions; then
|
. $init_functions
|
-else
|
+fi
|
+
|
+# newer Red Hat releases don't seem to have the below functions
|
+# in /etc/init.d/functions or elsewhere anymore
|
+if ! type -f log_success_msg >/dev/null; then
|
log_success_msg()
|
{
|
echo " SUCCESS! $@"
|
}
|
+fi
|
+
|
+if ! type -f log_failure_msg >/dev/null; then
|
log_failure_msg()
|
{
|
echo " ERROR! $@"
|