[OE-core] systemd service vs. update-alternatives (was rsyslog: buggy systemd/ua handling?)

Steffen Sledz sledz at dresearch-fe.de
Fri Nov 20 13:42:31 UTC 2015


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 at 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



More information about the Openembedded-core mailing list