diff mbox series

initscripts: add function log_success_msg/log_failure_msg/log_warning_msg

Message ID 20250403085305.3667237-1-changqing.li@windriver.com
State Accepted, archived
Commit b57824d0ec593898abd9eb957c2ff1317bb74440
Headers show
Series initscripts: add function log_success_msg/log_failure_msg/log_warning_msg | expand

Commit Message

Changqing Li April 3, 2025, 8:53 a.m. UTC
From: Changqing Li <changqing.li@windriver.com>

* 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

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 .../initscripts/initscripts-1.0/functions     | 21 +++++++++++++++++++
 .../initscripts/initscripts_1.0.bb            |  1 -
 2 files changed, 21 insertions(+), 1 deletion(-)

Comments

Randy MacLeod April 7, 2025, 7:21 p.m. UTC | #1
On 2025-04-03 4:53 a.m., Changqing Li via lists.openembedded.org wrote:
> From: Changqing Li<changqing.li@windriver.com>
>
> * 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
>
> Signed-off-by: Changqing Li<changqing.li@windriver.com>
> ---
>   .../initscripts/initscripts-1.0/functions     | 21 +++++++++++++++++++
>   .../initscripts/initscripts_1.0.bb            |  1 -
>   2 files changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-core/initscripts/initscripts-1.0/functions b/meta/recipes-core/initscripts/initscripts-1.0/functions
> index 35aebd4a55..7fc19c808b 100755
> --- a/meta/recipes-core/initscripts/initscripts-1.0/functions
> +++ b/meta/recipes-core/initscripts/initscripts-1.0/functions
> @@ -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
> +}
> diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb
> index 98693fa66e..0bc078c5eb 100644
> --- a/meta/recipes-core/initscripts/initscripts_1.0.bb
> +++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
> @@ -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



>   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:openembedded-core+owner@lists.openembedded.org
> Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub [randy.macleod@windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Changqing Li April 8, 2025, 1:20 a.m. UTC | #2
On 4/8/25 03:21, Randy MacLeod wrote:
> On 2025-04-03 4:53 a.m., Changqing Li via lists.openembedded.org wrote:
>> From: Changqing Li<changqing.li@windriver.com>
>>
>> * 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
>>
>> Signed-off-by: Changqing Li<changqing.li@windriver.com>
>> ---
>>   .../initscripts/initscripts-1.0/functions     | 21 +++++++++++++++++++
>>   .../initscripts/initscripts_1.0.bb            |  1 -
>>   2 files changed, 21 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/recipes-core/initscripts/initscripts-1.0/functions b/meta/recipes-core/initscripts/initscripts-1.0/functions
>> index 35aebd4a55..7fc19c808b 100755
>> --- a/meta/recipes-core/initscripts/initscripts-1.0/functions
>> +++ b/meta/recipes-core/initscripts/initscripts-1.0/functions
>> @@ -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
>> +}
>> diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb
>> index 98693fa66e..0bc078c5eb 100644
>> --- a/meta/recipes-core/initscripts/initscripts_1.0.bb
>> +++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
>> @@ -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?
>
Sorry,  I don't know if there are other recipes and function missing.

//Changqing

> ../Randy
>
>
>
>>   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:openembedded-core+owner@lists.openembedded.org
>> Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub  [randy.macleod@windriver.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
>
> -- 
> # Randy MacLeod
> # Wind River Linux
diff mbox series

Patch

diff --git a/meta/recipes-core/initscripts/initscripts-1.0/functions b/meta/recipes-core/initscripts/initscripts-1.0/functions
index 35aebd4a55..7fc19c808b 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/functions
+++ b/meta/recipes-core/initscripts/initscripts-1.0/functions
@@ -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
+}
diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb
index 98693fa66e..0bc078c5eb 100644
--- a/meta/recipes-core/initscripts/initscripts_1.0.bb
+++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
@@ -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"