rsyslog: buggy systemd/ua handling?
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?
Signature · 7 lines
DResearch Fahrzeugelektronik GmbH Otto-Schmirgal-Str. 3, 10319 Berlin, Germany Tel: +49 30 515932-237 mailto:[email protected] Fax: +49 30 515932-299 Geschäftsführer: Dr. Michael Weber, Werner Mögle; Amtsgericht Berlin Charlottenburg; HRB 130120 B; Ust.-IDNr. DE273952058
Quoted 12 lines · Steffen Sledz
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
Quoted 7 lines
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.
Signature · 7 lines
DResearch Fahrzeugelektronik GmbH Otto-Schmirgal-Str. 3, 10319 Berlin, Germany Tel: +49 30 515932-237 mailto:[email protected] Fax: +49 30 515932-299 Geschäftsführer: Dr. Michael Weber, Werner Mögle; Amtsgericht Berlin Charlottenburg; HRB 130120 B; Ust.-IDNr. DE273952058
A message that is not in the archive (sent off-list or not yet received): [email protected]
systemd service vs. update-alternatives (was rsyslog: buggy systemd/ua handling?)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 12 lines · Steffen Sledz
Quoted 11 lines · Steffen Sledz
Quoted 10 lines · Steffen Sledz
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"
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
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.serviceI 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:[email protected]
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-----
Re: systemd service vs. update-alternatives (was rsyslog: buggy systemd/ua handling?)
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
Quoted 68 lines · Steffen Sledz
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Quoted 10 lines · Steffen Sledz
Quoted 9 lines · Steffen Sledz
Quoted 8 lines · Steffen Sledz
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
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
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_installstage got among others this line:ln -sf /dev/null ${D}${systemd_unitdir}/system/syslog.serviceI 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.serviceSo 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:[email protected]
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 v2iQIcBAEBAgAGBQJWTd3kAAoJEIz5slJ1krPh0f4QAIoQcwiyYs1l1lCCFhg96xry 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-----
Re: systemd service vs. update-alternatives (was rsyslog: buggy systemd/ua handling?)
Quoted 4 lines · ChenQi
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>?
Signature · 7 lines
DResearch Fahrzeugelektronik GmbH Otto-Schmirgal-Str. 3, 10319 Berlin, Germany Tel: +49 30 515932-237 mailto:[email protected] Fax: +49 30 515932-299 Geschäftsführer: Dr. Michael Weber, Werner Mögle; Amtsgericht Berlin Charlottenburg; HRB 130120 B; Ust.-IDNr. DE273952058
Re: systemd service vs. update-alternatives (was rsyslog: buggy systemd/ua handling?)
Quoted 1 line · Steffen Sledz
PS: What's the better place for this discussion? This mailing list? Or <https://bugzilla.yoctoproject.org/show_bug.cgi?id=8688>?
Ping!
Signature · 7 lines
DResearch Fahrzeugelektronik GmbH Otto-Schmirgal-Str. 3, 10319 Berlin, Germany Tel: +49 30 515932-237 mailto:[email protected] Fax: +49 30 515932-299 Geschäftsführer: Dr. Michael Weber, Werner Mögle; Amtsgericht Berlin Charlottenburg; HRB 130120 B; Ust.-IDNr. DE273952058