Skip to contentSkip to conversation

initscripts: add function log_success_msg/log_failure_msg/log_warning_msg

PATCH In review [email protected] 2 participants 3 messages Apr 3, 2025 – Apr 8, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 initscripts: add function log_success_msg/log_failure_msg/log_warning_msg

From: Changqing Li <[email protected]>

* add function log_success_msg/log_failure_msg/log_warning_msg, some packages still use these functions, like mariadb, refer [1], without these function, with sysV init manager, mariadb will report error:

root@qemux86-64:~# /etc/init.d/mysqld status
/etc/init.d/mysqld: line 383: log_success_msg: command not found

* remove RCONFLICTS with lsbinitscripts, LSB support already remove in
[2]

[1] https://github.com/MariaDB/server/blob/main/support-files/mysql.server.sh#L104
[2] https://git.openembedded.org/openembedded-core/commit/?id=fb064356af615d67d85b65942103bf943d84d290
[3] https://refspecs.linuxbase.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/iniscrptfunc.html

---
 .../initscripts/initscripts-1.0/functions     | 21 +++++++++++++++++++
 .../initscripts/initscripts_1.0.bb            |  1 -
 2 files changed, 21 insertions(+), 1 deletion(-)
meta/recipes-core/initscripts/initscripts-1.0/functions +21 -0
index 35aebd4a55..7fc19c808b 100755
@@ -92,3 +92,24 @@ passed() {
     echo -n -e "${BRACKET}[${SUCCESS} PASS ${BRACKET}]${NORMAL}"
     return $rc
 }
+
+log_success_msg()
+{
+    echo -n $@
+    success
+    echo
+}
+
+log_failure_msg()
+{
+    echo -n $@
+    failure
+    echo
+}
+
+log_warning_msg()
+{
+    echo -n $@
+    warning
+    echo
+}
meta/recipes-core/initscripts/initscripts_1.0.bb +0 -1
index 98693fa66e..0bc078c5eb 100644
@@ -54,7 +54,6 @@ RDEPENDS:${PN} = "initd-functions \
 # Recommend pn-functions so that it will be a preferred default provider for initd-functions
 RRECOMMENDS:${PN} = "${PN}-functions"
 RPROVIDES:${PN}-functions = "initd-functions"
-RCONFLICTS:${PN}-functions = "lsbinitscripts"
 FILES:${PN}-functions = "${sysconfdir}/init.d/functions*"
 FILES:${PN}-sushell = "${base_sbindir}/sushell"
 
Signature · 1 line
2.34.1
#1 lore raw
Quoted 56 lines · Changqing Li via lists.openembedded.org

From: Changqing Li<[email protected]>

* add function log_success_msg/log_failure_msg/log_warning_msg, some packages still use these functions, like mariadb, refer [1], without these function, with sysV init manager, mariadb will report error:

root@qemux86-64:~# /etc/init.d/mysqld status
/etc/init.d/mysqld: line 383: log_success_msg: command not found

* remove RCONFLICTS with lsbinitscripts, LSB support already remove in
[2]

[1]https://github.com/MariaDB/server/blob/main/support-files/mysql.server.sh#L104 [2]https://git.openembedded.org/openembedded-core/commit/?id=fb064356af615d67d85b65942103bf943d84d290 [3]https://refspecs.linuxbase.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/iniscrptfunc.html

---
  .../initscripts/initscripts-1.0/functions     | 21 +++++++++++++++++++
  .../initscripts/initscripts_1.0.bb            |  1 -
  2 files changed, 21 insertions(+), 1 deletion(-)
meta/recipes-core/initscripts/initscripts-1.0/functions +21 -0
index 35aebd4a55..7fc19c808b 100755
@@ -92,3 +92,24 @@ passed() {
      echo -n -e "${BRACKET}[${SUCCESS} PASS ${BRACKET}]${NORMAL}"
      return $rc
  }
+
+log_success_msg()
+{
+    echo -n $@
+    success
+    echo
+}
+
+log_failure_msg()
+{
+    echo -n $@
+    failure
+    echo
+}
+
+log_warning_msg()
+{
+    echo -n $@
+    warning
+    echo
+}
meta/recipes-core/initscripts/initscripts_1.0.bb +0 -0
index 98693fa66e..0bc078c5eb 100644

meta/recipes-core/initscripts/initscripts_1.0.bb RDEPENDS:${PN} = "initd-functions \ · line 57

Quoted 4 lines
meta/recipes-core/initscripts/initscripts_1.0.bb +0 -1
@@ -54,7 +54,6 @@ RDEPENDS:${PN} = "initd-functions \
  # Recommend pn-functions so that it will be a preferred default provider for initd-functions
  RRECOMMENDS:${PN} = "${PN}-functions"
  RPROVIDES:${PN}-functions = "initd-functions"
-RCONFLICTS:${PN}-functions = "lsbinitscripts"

Patch discussed in patch review and while this will likely get merged,
since if your distro has these functions scripts, then your distro should have the log_* functions or you get an error as Changqing described above.

By adding these simple initscript functions we'll have to carry them indefinitely since it'll never be clear if someone who doesn't have a recipe in the layer index is making use of them.

In the last 3 or 4 years people have added conditional code to handle the non-redhat case:

https://github.com/MariaDB/server/blame/main/support-files/mysql.server.sh#L93

Changqing,

Are there other recipes that need these log functions that you know of?

Are there other functions missing?

../Randy

Quoted 12 lines
meta/recipes-core/initscripts/initscripts_1.0.bb +0 -1
  FILES:${PN}-functions = "${sysconfdir}/init.d/functions*"
  FILES:${PN}-sushell = "${base_sbindir}/sushell"
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#214308):https://lists.openembedded.org/g/openembedded-core/message/214308 Mute This Topic:https://lists.openembedded.org/mt/112062232/3616765
Group Owner:[email protected] Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 2 lines
# Randy MacLeod
# Wind River Linux
#2 lore raw
Quoted 73 lines · Randy MacLeod
Quoted 56 lines · Changqing Li via lists.openembedded.org

From: Changqing Li<[email protected]>

* add function log_success_msg/log_failure_msg/log_warning_msg, some packages still use these functions, like mariadb, refer [1], without these function, with sysV init manager, mariadb will report error:

root@qemux86-64:~# /etc/init.d/mysqld status
/etc/init.d/mysqld: line 383: log_success_msg: command not found

* remove RCONFLICTS with lsbinitscripts, LSB support already remove in
[2]

[1]https://github.com/MariaDB/server/blob/main/support-files/mysql.server.sh#L104 [2]https://git.openembedded.org/openembedded-core/commit/?id=fb064356af615d67d85b65942103bf943d84d290 [3]https://refspecs.linuxbase.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/iniscrptfunc.html

---
  .../initscripts/initscripts-1.0/functions     | 21 +++++++++++++++++++
  .../initscripts/initscripts_1.0.bb            |  1 -
  2 files changed, 21 insertions(+), 1 deletion(-)
meta/recipes-core/initscripts/initscripts-1.0/functions +21 -0
index 35aebd4a55..7fc19c808b 100755
@@ -92,3 +92,24 @@ passed() {
      echo -n -e "${BRACKET}[${SUCCESS} PASS ${BRACKET}]${NORMAL}"
      return $rc
  }
+
+log_success_msg()
+{
+    echo -n $@
+    success
+    echo
+}
+
+log_failure_msg()
+{
+    echo -n $@
+    failure
+    echo
+}
+
+log_warning_msg()
+{
+    echo -n $@
+    warning
+    echo
+}
meta/recipes-core/initscripts/initscripts_1.0.bb +0 -0
index 98693fa66e..0bc078c5eb 100644

meta/recipes-core/initscripts/initscripts_1.0.bb RDEPENDS:${PN} = "initd-functions \ · line 57

Quoted 4 lines
meta/recipes-core/initscripts/initscripts_1.0.bb +0 -1
@@ -54,7 +54,6 @@ RDEPENDS:${PN} = "initd-functions \
  # Recommend pn-functions so that it will be a preferred default provider for initd-functions
  RRECOMMENDS:${PN} = "${PN}-functions"
  RPROVIDES:${PN}-functions = "initd-functions"
-RCONFLICTS:${PN}-functions = "lsbinitscripts"

Patch discussed in patch review and while this will likely get merged,
since if your distro has these functions scripts, then your distro should have the log_* functions or you get an error as Changqing described above.

By adding these simple initscript functions we'll have to carry them indefinitely since it'll never be clear if someone who doesn't have a recipe in the layer index is making use of them.

In the last 3 or 4 years people have added conditional code to handle the non-redhat case:

Quoted 9 lines

https://github.com/MariaDB/server/blame/main/support-files/mysql.server.sh#L93

Changqing,

Are there other recipes that need these log functions that you know of?

Are there other functions missing?

Sorry,  I don't know if there are other recipes and function missing.

//Changqing

Quoted 20 lines

../Randy

Quoted 12 lines
meta/recipes-core/initscripts/initscripts_1.0.bb +0 -1
  FILES:${PN}-functions = "${sysconfdir}/init.d/functions*"
  FILES:${PN}-sushell = "${base_sbindir}/sushell"
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#214308):https://lists.openembedded.org/g/openembedded-core/message/214308 Mute This Topic:https://lists.openembedded.org/mt/112062232/3616765
Group Owner:[email protected] Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 2 lines
# Randy MacLeod
# Wind River Linux