Patchwork [2/2] sysklogd: lower the ALTERNATIVE_PRIORITY in case of systemd

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date Sept. 2, 2013, 11:40 a.m.
Message ID <35139b57aba1b70ba9780e19765c1ef54cd4bab7.1378121740.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/57215/
State New
Headers show

Comments

Qi.Chen@windriver.com - Sept. 2, 2013, 11:40 a.m.
From: Chen Qi <Qi.Chen@windriver.com>

The sysklogd package hasn't got systemd support yet. So in case of
a systemd based system, the commands and corresponding configuration
files should have a lower priority than that of the busybox's syslogd
and klogd utilities. These two utilities from busybox have internal
systemd support if CONFIG_FEATURE_SYSTEMD is enabled. And that config
item is enabled by default.

[YOCTO #5066]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-extended/sysklogd/sysklogd.inc |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
Peter Bigot - Sept. 2, 2013, 11:58 a.m.
On 09/02/2013 06:40 AM, Qi.Chen@windriver.com wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
>
> The sysklogd package hasn't got systemd support yet. So in case of
> a systemd based system, the commands and corresponding configuration
> files should have a lower priority than that of the busybox's syslogd
> and klogd utilities. These two utilities from busybox have internal
> systemd support if CONFIG_FEATURE_SYSTEMD is enabled. And that config
> item is enabled by default.
>
> [YOCTO #5066]
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>   meta/recipes-extended/sysklogd/sysklogd.inc |    9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-extended/sysklogd/sysklogd.inc b/meta/recipes-extended/sysklogd/sysklogd.inc
> index 1167328..30dac2d 100644
> --- a/meta/recipes-extended/sysklogd/sysklogd.inc
> +++ b/meta/recipes-extended/sysklogd/sysklogd.inc
> @@ -38,7 +38,14 @@ do_install () {
>   	install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog
>   }
>   
> -ALTERNATIVE_PRIORITY = "100"
> +python () {
> +    # sysklogd package has no internal systemd support, so we weigh busybox's
> +    # sysklogd utility over it in case of systemd
> +    if 'systemd' in d.getVar("DISTRO_FEATURES", True).split():
> +        d.setVar("ALTERNATIVE_PRIORITY", "10")
> +    else:
> +        d.setVar("ALTERNATIVE_PRIORITY", "100")
> +}

Is there a reason an anonymous python block is better for this purpose than:

ALTERNATIVE_PRIORITY = "${@base_contains('DISTRO_FEATURES','systemd','10','100',d)}"

?

>   ALTERNATIVE_${PN} = "syslogd klogd syslog-init syslog-conf"
>
Qi.Chen@windriver.com - Sept. 3, 2013, 2:06 a.m.
On 09/02/2013 07:58 PM, Peter A. Bigot wrote:
> On 09/02/2013 06:40 AM, Qi.Chen@windriver.com wrote:
>> From: Chen Qi <Qi.Chen@windriver.com>
>>
>> The sysklogd package hasn't got systemd support yet. So in case of
>> a systemd based system, the commands and corresponding configuration
>> files should have a lower priority than that of the busybox's syslogd
>> and klogd utilities. These two utilities from busybox have internal
>> systemd support if CONFIG_FEATURE_SYSTEMD is enabled. And that config
>> item is enabled by default.
>>
>> [YOCTO #5066]
>>
>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>> ---
>>   meta/recipes-extended/sysklogd/sysklogd.inc |    9 ++++++++-
>>   1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/recipes-extended/sysklogd/sysklogd.inc 
>> b/meta/recipes-extended/sysklogd/sysklogd.inc
>> index 1167328..30dac2d 100644
>> --- a/meta/recipes-extended/sysklogd/sysklogd.inc
>> +++ b/meta/recipes-extended/sysklogd/sysklogd.inc
>> @@ -38,7 +38,14 @@ do_install () {
>>       install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog
>>   }
>>   -ALTERNATIVE_PRIORITY = "100"
>> +python () {
>> +    # sysklogd package has no internal systemd support, so we weigh 
>> busybox's
>> +    # sysklogd utility over it in case of systemd
>> +    if 'systemd' in d.getVar("DISTRO_FEATURES", True).split():
>> +        d.setVar("ALTERNATIVE_PRIORITY", "10")
>> +    else:
>> +        d.setVar("ALTERNATIVE_PRIORITY", "100")
>> +}
>
> Is there a reason an anonymous python block is better for this purpose 
> than:
>
> ALTERNATIVE_PRIORITY = 
> "${@base_contains('DISTRO_FEATURES','systemd','10','100',d)}"
>
> ?
>
Thanks. I'll send out a V2.

Best Regards,
Chen Qi

>>   ALTERNATIVE_${PN} = "syslogd klogd syslog-init syslog-conf"
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
>

Patch

diff --git a/meta/recipes-extended/sysklogd/sysklogd.inc b/meta/recipes-extended/sysklogd/sysklogd.inc
index 1167328..30dac2d 100644
--- a/meta/recipes-extended/sysklogd/sysklogd.inc
+++ b/meta/recipes-extended/sysklogd/sysklogd.inc
@@ -38,7 +38,14 @@  do_install () {
 	install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog
 }
 
-ALTERNATIVE_PRIORITY = "100"
+python () {
+    # sysklogd package has no internal systemd support, so we weigh busybox's
+    # sysklogd utility over it in case of systemd
+    if 'systemd' in d.getVar("DISTRO_FEATURES", True).split():
+        d.setVar("ALTERNATIVE_PRIORITY", "10")
+    else:
+        d.setVar("ALTERNATIVE_PRIORITY", "100")
+}
 
 ALTERNATIVE_${PN} = "syslogd klogd syslog-init syslog-conf"