All of lore.kernel.org
 help / color / mirror / Atom feed
* rsyslog: buggy systemd/ua handling?
@ 2015-11-16 11:28 Steffen Sledz
  2015-11-17  8:08 ` Steffen Sledz
  0 siblings, 1 reply; 6+ messages in thread
From: Steffen Sledz @ 2015-11-16 11:28 UTC (permalink / raw)
  To: openembedded-devel, Kang Kai, Martin Jansa, Chen Qi

I'm not sure but i believe there's a bug in the systemd/ua-handling in meta-oe/recipes-extended/rsyslog/rsyslog_7.6.1.bb.

In my opinion this code

    if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
        pn = d.getVar('PN', True)
        d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-service')
        d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-service', '%s/systemd/system/syslog.service' % (d.getVar('sysconfdir', True)))
        d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-service', '%s/system/rsyslog.service' % (d.getVar('systemd_unitdir', True)))

registers the systemd service file under the (ua-)name "syslog-service". So it should not be

  SYSTEMD_SERVICE_${PN} = "${BPN}.service"

but

  SYSTEMD_SERVICE_${PN} = "syslog.service"

Right?

-- 
DResearch Fahrzeugelektronik GmbH
Otto-Schmirgal-Str. 3, 10319 Berlin, Germany
Tel: +49 30 515932-237 mailto:sledz@dresearch-fe.de
Fax: +49 30 515932-299
Geschäftsführer: Dr. Michael Weber, Werner Mögle;
Amtsgericht Berlin Charlottenburg; HRB 130120 B;
Ust.-IDNr. DE273952058


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: rsyslog: buggy systemd/ua handling?
  2015-11-16 11:28 rsyslog: buggy systemd/ua handling? Steffen Sledz
@ 2015-11-17  8:08 ` Steffen Sledz
       [not found]   ` <564CA3F8.9020404@dresearch-fe.de>
  0 siblings, 1 reply; 6+ messages in thread
From: Steffen Sledz @ 2015-11-17  8:08 UTC (permalink / raw)
  To: openembedded-devel, Kang Kai, Martin Jansa, Chen Qi, Ross Burton,
	Armin Kuster

On 16.11.2015 12:28, Steffen Sledz wrote:
> I'm not sure but i believe there's a bug in the systemd/ua-handling in meta-oe/recipes-extended/rsyslog/rsyslog_7.6.1.bb.
> 
> In my opinion this code
> 
>     if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
>         pn = d.getVar('PN', True)
>         d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-service')
>         d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-service', '%s/systemd/system/syslog.service' % (d.getVar('sysconfdir', True)))
>         d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-service', '%s/system/rsyslog.service' % (d.getVar('systemd_unitdir', True)))
> 
> registers the systemd service file under the (ua-)name "syslog-service". So it should not be
> 
>   SYSTEMD_SERVICE_${PN} = "${BPN}.service"
> 
> but
> 
>   SYSTEMD_SERVICE_${PN} = "syslog.service"
> 
> Right?

Hi experts! Is my assumption correct? If yes i would prepare patches for master, fido and jethro.

-- 
DResearch Fahrzeugelektronik GmbH
Otto-Schmirgal-Str. 3, 10319 Berlin, Germany
Tel: +49 30 515932-237 mailto:sledz@dresearch-fe.de
Fax: +49 30 515932-299
Geschäftsführer: Dr. Michael Weber, Werner Mögle;
Amtsgericht Berlin Charlottenburg; HRB 130120 B;
Ust.-IDNr. DE273952058


^ permalink raw reply	[flat|nested] 6+ messages in thread

* systemd service vs. update-alternatives (was rsyslog: buggy systemd/ua handling?)
       [not found]   ` <564CA3F8.9020404@dresearch-fe.de>
@ 2015-11-19 14:34     ` Steffen Sledz
  2015-11-20  9:06       ` ChenQi
  0 siblings, 1 reply; 6+ messages in thread
From: Steffen Sledz @ 2015-11-19 14:34 UTC (permalink / raw)
  To: Kang Kai, Martin Jansa, Chen Qi, Ross Burton, Radu Moisan,
	openembedded-core, Andreas Müller, Khem Raj, Koen Kooi,
	Jonathan Liu

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 18.11.2015 17:14, Steffen Sledz wrote:
> On 17.11.2015 09:08, Steffen Sledz wrote:
>> On 16.11.2015 12:28, Steffen Sledz wrote:
>>> I'm not sure but i believe there's a bug in the systemd/ua-handling in meta-oe/recipes-extended/rsyslog/rsyslog_7.6.1.bb.
>>> 
>>> In my opinion this code
>>> 
>>> if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d): pn = d.getVar('PN', True) d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-service') d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-service', '%s/systemd/system/syslog.service' % (d.getVar('sysconfdir', True))) d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-service', '%s/system/rsyslog.service' % (d.getVar('systemd_unitdir', True)))
>>> 
>>> registers the systemd service file under the (ua-)name "syslog-service". So it should not be
>>> 
>>> SYSTEMD_SERVICE_${PN} = "${BPN}.service"
>>> 
>>> but
>>> 
>>> SYSTEMD_SERVICE_${PN} = "syslog.service"
>>> 
>>> Right?
>> 
>> Hi experts! Is my assumption correct? If yes i would prepare patches for master, fido and jethro.

The problem seems to be much more complex then I thought before. :(

The systemd integration for busybox-syslog was introduced by commit cf3618f9a57e46fb78d5be35d473e2dd5290e961.

The do_install stage got among others this line:

  ln -sf /dev/null ${D}${systemd_unitdir}/system/syslog.service

I believe this was made to avoid a package error like this:

  ERROR: Function failed: SYSTEMD_SERVICE_busybox-syslog value syslog.service does not exist

But if another syslog alternative (rsyslog or syslog-ng) will do the same this leads to another error:

  ERROR: The recipe busybox is trying to install files into a shared area when those files already exist. Those files and their manifest location are:
   /home/sledz/work/hipos-dfe.fido/build-closed/tmp-glibc/sysroots/himx0294/lib/systemd/system/syslog.service

So what is th right way to bring a systemd service file and update-alternatives together???

- -- 
DResearch Fahrzeugelektronik GmbH
Otto-Schmirgal-Str. 3, 10319 Berlin, Germany
Tel: +49 30 515932-237 mailto:sledz@dresearch-fe.de
Fax: +49 30 515932-299
Geschäftsführer: Dr. Michael Weber, Werner Mögle;
Amtsgericht Berlin Charlottenburg; HRB 130120 B;
Ust.-IDNr. DE273952058
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJWTd3kAAoJEIz5slJ1krPh0f4QAIoQcwiyYs1l1lCCFhg96xry
5wFMCFDdtCCPerpLBPHh0nLcqB5z0JKV9wCfuZu2QBZbh49s/0Qg4F09yN7qT2Bb
auP3yEVIZrekuVIpQYkXOTI5q+1DrC4QCGMFfm7XaJZiqdOBaP9t1xWMQxzA5W3M
OyQCH3JDABkD9UJQbsYLs1Qq6jm1rzbD1ZO5Uv0JvZaW+ZyHvDUHN7M+nlCxWFKE
HPTtri1trgg9iZYZgTG0y2WferO5Unug5TKrFMSLiKv8iwOGha2O45m9nsFWCzZL
vQ+6z1mnL9syVy6kmOakmc2Q+RnSC6Zx2Y3GbPuUMGtn4Y3neole6YaMJ0Yl+Uk7
nn49/f7qxAD6sYJu7YaD0oBbEj/ugKbtFzKcwWjAe365h21Cndt2NkhELr1xUk7/
owwVD60mmPHGCQ6ugT6wSnmLAVO4P5td5HLuDKWIDV2Smtm3XAQ2MQ52vFzr53sh
dyUq3e5J9zuDbYWmC5xRvv77H7R6eUCltkGNHg5JjkbqtUw4NQWteaHTUpM7KlI1
23w0nDU1xACpJDs+TgMzNyo7c+0b0g0SKjw07Qo7aIdNJuHoeik+hJIewMU7KDdl
BjHy1PIFqXdSPR3myMOMOXlDCYJLJSy19roOr067LSiwXSEwycj93AsqMNzaGSWS
8o0HjDbiMarMi2aXCyCH
=4bav
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: systemd service vs. update-alternatives (was rsyslog: buggy systemd/ua handling?)
  2015-11-19 14:34     ` systemd service vs. update-alternatives (was rsyslog: buggy systemd/ua handling?) Steffen Sledz
@ 2015-11-20  9:06       ` ChenQi
  2015-11-20 13:42         ` Steffen Sledz
  0 siblings, 1 reply; 6+ messages in thread
From: ChenQi @ 2015-11-20  9:06 UTC (permalink / raw)
  To: Steffen Sledz, Kang Kai, Martin Jansa, Ross Burton, Radu Moisan,
	openembedded-core, Andreas Müller, Khem Raj, Koen Kooi,
	Jonathan Liu

I sent out a series of patches regarding syslog & systemd some time ago.
The title is "[OE-core] [PATCH V3 0/4] Fixes for systemd services in 
systemd".
Codes regarding update-alternatives and syslog for 'rsyslog' recipe is 
actually part of the whole fix.
You could try the patch series to see if they work for you.

Regards,
Chen Qi

On 11/19/2015 10:34 PM, Steffen Sledz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 18.11.2015 17:14, Steffen Sledz wrote:
>> On 17.11.2015 09:08, Steffen Sledz wrote:
>>> On 16.11.2015 12:28, Steffen Sledz wrote:
>>>> I'm not sure but i believe there's a bug in the systemd/ua-handling in meta-oe/recipes-extended/rsyslog/rsyslog_7.6.1.bb.
>>>>
>>>> In my opinion this code
>>>>
>>>> if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d): pn = d.getVar('PN', True) d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-service') d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-service', '%s/systemd/system/syslog.service' % (d.getVar('sysconfdir', True))) d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-service', '%s/system/rsyslog.service' % (d.getVar('systemd_unitdir', True)))
>>>>
>>>> registers the systemd service file under the (ua-)name "syslog-service". So it should not be
>>>>
>>>> SYSTEMD_SERVICE_${PN} = "${BPN}.service"
>>>>
>>>> but
>>>>
>>>> SYSTEMD_SERVICE_${PN} = "syslog.service"
>>>>
>>>> Right?
>>> Hi experts! Is my assumption correct? If yes i would prepare patches for master, fido and jethro.
> The problem seems to be much more complex then I thought before. :(
>
> The systemd integration for busybox-syslog was introduced by commit cf3618f9a57e46fb78d5be35d473e2dd5290e961.
>
> The do_install stage got among others this line:
>
>    ln -sf /dev/null ${D}${systemd_unitdir}/system/syslog.service
>
> I believe this was made to avoid a package error like this:
>
>    ERROR: Function failed: SYSTEMD_SERVICE_busybox-syslog value syslog.service does not exist
>
> But if another syslog alternative (rsyslog or syslog-ng) will do the same this leads to another error:
>
>    ERROR: The recipe busybox is trying to install files into a shared area when those files already exist. Those files and their manifest location are:
>     /home/sledz/work/hipos-dfe.fido/build-closed/tmp-glibc/sysroots/himx0294/lib/systemd/system/syslog.service
>
> So what is th right way to bring a systemd service file and update-alternatives together???
>
> - -- 
> DResearch Fahrzeugelektronik GmbH
> Otto-Schmirgal-Str. 3, 10319 Berlin, Germany
> Tel: +49 30 515932-237 mailto:sledz@dresearch-fe.de
> Fax: +49 30 515932-299
> Geschäftsführer: Dr. Michael Weber, Werner Mögle;
> Amtsgericht Berlin Charlottenburg; HRB 130120 B;
> Ust.-IDNr. DE273952058
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
>
> iQIcBAEBAgAGBQJWTd3kAAoJEIz5slJ1krPh0f4QAIoQcwiyYs1l1lCCFhg96xry
> 5wFMCFDdtCCPerpLBPHh0nLcqB5z0JKV9wCfuZu2QBZbh49s/0Qg4F09yN7qT2Bb
> auP3yEVIZrekuVIpQYkXOTI5q+1DrC4QCGMFfm7XaJZiqdOBaP9t1xWMQxzA5W3M
> OyQCH3JDABkD9UJQbsYLs1Qq6jm1rzbD1ZO5Uv0JvZaW+ZyHvDUHN7M+nlCxWFKE
> HPTtri1trgg9iZYZgTG0y2WferO5Unug5TKrFMSLiKv8iwOGha2O45m9nsFWCzZL
> vQ+6z1mnL9syVy6kmOakmc2Q+RnSC6Zx2Y3GbPuUMGtn4Y3neole6YaMJ0Yl+Uk7
> nn49/f7qxAD6sYJu7YaD0oBbEj/ugKbtFzKcwWjAe365h21Cndt2NkhELr1xUk7/
> owwVD60mmPHGCQ6ugT6wSnmLAVO4P5td5HLuDKWIDV2Smtm3XAQ2MQ52vFzr53sh
> dyUq3e5J9zuDbYWmC5xRvv77H7R6eUCltkGNHg5JjkbqtUw4NQWteaHTUpM7KlI1
> 23w0nDU1xACpJDs+TgMzNyo7c+0b0g0SKjw07Qo7aIdNJuHoeik+hJIewMU7KDdl
> BjHy1PIFqXdSPR3myMOMOXlDCYJLJSy19roOr067LSiwXSEwycj93AsqMNzaGSWS
> 8o0HjDbiMarMi2aXCyCH
> =4bav
> -----END PGP SIGNATURE-----
>
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: systemd service vs. update-alternatives (was rsyslog: buggy systemd/ua handling?)
  2015-11-20  9:06       ` ChenQi
@ 2015-11-20 13:42         ` Steffen Sledz
  2015-11-23 10:26           ` Steffen Sledz
  0 siblings, 1 reply; 6+ messages in thread
From: Steffen Sledz @ 2015-11-20 13:42 UTC (permalink / raw)
  To: ChenQi, Kang Kai, Martin Jansa, Ross Burton, Radu Moisan,
	openembedded-core, Andreas Müller, Khem Raj, Koen Kooi,
	Jonathan Liu

On 20.11.2015 10:06, ChenQi wrote:
> I sent out a series of patches regarding syslog & systemd some time ago.
> The title is "[OE-core] [PATCH V3 0/4] Fixes for systemd services in systemd".
> Codes regarding update-alternatives and syslog for 'rsyslog' recipe is actually part of the whole fix.
> You could try the patch series to see if they work for you.

I've applied your four patches to our fido based build environment (with a little modification because systemd was updated from 216 to 219).

Here are the results of my first tests:

----------------------------------------------------------------------
(1) busybox-syslog only

Everything seems to be OK.

----------------------------------------------------------------------
(2) opkg install sysklogd_1.5.1-r0.0_armv5e.ipk

Job for sysklogd.service failed. See "systemctl status sysklogd.service" and "journalctl -xe" for details.
Collected errors:
 * pkg_run_script: package "sysklogd" postinst script returned status 1.
 * opkg_configure: sysklogd.postinst returned 1.

# ps aux | grep syslog;ll /etc/systemd/system/*syslog*;ll /sbin/syslogd;systemctl status syslog.service;systemctl status busybox-syslog.service;systemctl status sysklogd.service
root     24123  0.0  0.1   2256  1528 ?        Ss   13:21   0:00 /sbin/syslogd -n -C
root     24291  0.0  0.1   2244  1272 pts/0    S+   13:22   0:00 grep syslog
lrwxrwxrwx    1 root     root            36 Nov 20 13:21 /etc/systemd/system/syslog.service -> /lib/systemd/system/sysklogd.service
lrwxrwxrwx    1 root     root            22 Nov 20 13:21 /sbin/syslogd -> /sbin/syslogd.sysklogd*
● sysklogd.service - System Logging Service
   Loaded: loaded (/lib/systemd/system/sysklogd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2015-11-20 13:21:57 UTC; 24s ago
  Process: 24278 ExecStart=/sbin/syslogd $SYSLOGD (code=exited, status=1/FAILURE)
● busybox-syslog.service - System Logging Service
   Loaded: loaded (/lib/systemd/system/busybox-syslog.service; indirect; vendor preset: enabled)
   Active: active (running) since Fri 2015-11-20 13:21:14 UTC; 1min 8s ago
 Main PID: 24123 (syslogd)
   CGroup: /system.slice/busybox-syslog.service
           └─24123 /sbin/syslogd -n -C
● sysklogd.service - System Logging Service
   Loaded: loaded (/lib/systemd/system/sysklogd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2015-11-20 13:21:57 UTC; 24s ago
  Process: 24278 ExecStart=/sbin/syslogd $SYSLOGD (code=exited, status=1/FAILURE)

So the symlinks seem to be OK. But why is busybox-syslog.service as running and sysklogd.service as failed.

----------------------------------------------------------------------
(3) opkg remove sysklogd

Warning: Stopping sysklogd.service, but it can still be activated by:
  syslog.socket

Evrything seems to be OK. All symlinks are set right. sysklogd.service is reported as not-found

----------------------------------------------------------------------
(4) opkg install sysklogd_1.5.1-r0.0_armv5e.ipk

This time no postinst error. But two syslogd instances are running and busybox-syslog.service is reported as running again.

# ps aux | grep syslog;ll /etc/systemd/system/*syslog*;ll /sbin/syslogd;systemctl status syslog.service;systemctl status busybox-syslog.service;systemctl status sysklogd.service
root     24123  0.0  0.1   2256  1528 ?        Ss   13:21   0:00 /sbin/syslogd -n -C
root     24647  0.0  0.1   1788  1420 ?        Ss   13:23   0:00 /sbin/syslogd
root     24653  0.0  0.1   2244  1260 pts/0    S+   13:24   0:00 grep syslog
lrwxrwxrwx    1 root     root            36 Nov 20 13:23 /etc/systemd/system/syslog.service -> /lib/systemd/system/sysklogd.service
lrwxrwxrwx    1 root     root            22 Nov 20 13:23 /sbin/syslogd -> /sbin/syslogd.sysklogd*
● sysklogd.service - System Logging Service
   Loaded: loaded (/lib/systemd/system/sysklogd.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2015-11-20 13:23:55 UTC; 12s ago
  Process: 24646 ExecStart=/sbin/syslogd $SYSLOGD (code=exited, status=0/SUCCESS)
 Main PID: 24647 (syslogd)
   CGroup: /system.slice/sysklogd.service
           └─24647 /sbin/syslogd
● busybox-syslog.service - System Logging Service
   Loaded: loaded (/lib/systemd/system/busybox-syslog.service; indirect; vendor preset: enabled)
   Active: active (running) since Fri 2015-11-20 13:21:14 UTC; 2min 52s ago
 Main PID: 24123 (syslogd)
   CGroup: /system.slice/busybox-syslog.service
           └─24123 /sbin/syslogd -n -C
● sysklogd.service - System Logging Service
   Loaded: loaded (/lib/systemd/system/sysklogd.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2015-11-20 13:23:55 UTC; 12s ago
  Process: 24646 ExecStart=/sbin/syslogd $SYSLOGD (code=exited, status=0/SUCCESS)
 Main PID: 24647 (syslogd)
   CGroup: /system.slice/sysklogd.service
           └─24647 /sbin/syslogd

----------------------------------------------------------------------

So my first conclusion: It looks much better but not perfect yet.

I'll do some more researches next week.

Regards,
Steffen

PS: What's the better place for this discussion? This mailing list? Or <https://bugzilla.yoctoproject.org/show_bug.cgi?id=8688>?

-- 
DResearch Fahrzeugelektronik GmbH
Otto-Schmirgal-Str. 3, 10319 Berlin, Germany
Tel: +49 30 515932-237 mailto:sledz@dresearch-fe.de
Fax: +49 30 515932-299
Geschäftsführer: Dr. Michael Weber, Werner Mögle;
Amtsgericht Berlin Charlottenburg; HRB 130120 B;
Ust.-IDNr. DE273952058


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: systemd service vs. update-alternatives (was rsyslog: buggy systemd/ua handling?)
  2015-11-20 13:42         ` Steffen Sledz
@ 2015-11-23 10:26           ` Steffen Sledz
  0 siblings, 0 replies; 6+ messages in thread
From: Steffen Sledz @ 2015-11-23 10:26 UTC (permalink / raw)
  To: ChenQi, Kang Kai, Martin Jansa, Ross Burton, Radu Moisan,
	openembedded-core, Andreas Müller, Khem Raj, Koen Kooi,
	Jonathan Liu

On 20.11.2015 14:42, Steffen Sledz wrote:
> PS: What's the better place for this discussion? This mailing list? Or <https://bugzilla.yoctoproject.org/show_bug.cgi?id=8688>?

Ping!

-- 
DResearch Fahrzeugelektronik GmbH
Otto-Schmirgal-Str. 3, 10319 Berlin, Germany
Tel: +49 30 515932-237 mailto:sledz@dresearch-fe.de
Fax: +49 30 515932-299
Geschäftsführer: Dr. Michael Weber, Werner Mögle;
Amtsgericht Berlin Charlottenburg; HRB 130120 B;
Ust.-IDNr. DE273952058


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-11-23 10:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-16 11:28 rsyslog: buggy systemd/ua handling? Steffen Sledz
2015-11-17  8:08 ` Steffen Sledz
     [not found]   ` <564CA3F8.9020404@dresearch-fe.de>
2015-11-19 14:34     ` systemd service vs. update-alternatives (was rsyslog: buggy systemd/ua handling?) Steffen Sledz
2015-11-20  9:06       ` ChenQi
2015-11-20 13:42         ` Steffen Sledz
2015-11-23 10:26           ` Steffen Sledz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.