Bug 10944

Summary: syslog: don't use update-alternatives for init scripts
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Markus Lehtonen <markus.lehtonen>
Component: coreAssignee: Markus Lehtonen <markus.lehtonen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: mark.asselstine, markus.lehtonen, meta.mr.watcher, meta.watcher, oleksandr.poznyak
Version: 2.2   
Target Milestone: 2.5   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Bug Depends on: 9675    
Bug Blocks:    

Description Markus Lehtonen 2017-01-19 12:14:03 UTC
This bug is a follow-up to bug 10433.

Update-alternatives should not be used for managing init scripts. That causes problems in package scriptlets which enable/stop/start services at package (un)installation time. Syslog packages (busybox-syslog and sysklogd) are the only ones in oe-core doing this and they should be fixed. Currently, we don't see any crashes because of a workaround in update-alternatives and update-rc.d bbclasses (bug 10433). This workaround is basically only targeting the two syslog packages and a proper fix would be to revert the workaround and change the syslog packages to not use update-alternatives.

I already have a patchset at
http://git.openembedded.org/openembedded-core-contrib/log/?h=marquiz/fixes-10433

However, this cannot be merged, yet, because of bugs in opkg and smartpm.

In addition, fixing this bug should automatically resolve bug 8688.
Comment 1 Markus Lehtonen 2017-11-01 14:02:51 UTC
Removing the dependency on bug 10777 as opkg now uses libsolv by default which fixes the opkg-issues that were blocking this bug.
Comment 2 Markus Lehtonen 2017-11-01 14:03:42 UTC
Patchset sent for review:
https://patchwork.openembedded.org/series/9573/
Comment 3 Markus Lehtonen 2017-11-01 14:04:56 UTC
Moving milestone to 2.5
Comment 4 Ross Burton 2017-11-16 16:29:26 UTC
*** Bug 11343 has been marked as a duplicate of this bug. ***
Comment 5 Markus Lehtonen 2017-12-04 11:37:34 UTC
Fixed in oe-master:
http://git.openembedded.org/openembedded-core/commit/?id=061fa614cec49deb0374ccadf3013e5cc8ad2c51 (et al.)
Comment 6 Mark 2017-12-04 19:21:52 UTC
This seems to cause a conflict with inetutils in meta-networking. For example attempting to build an image which has both sysklogd and inetutils you will see:

---

[log_check] warning: %post(inetutils-doc-1.9.4-r0.core2_64) scriptlet failed, exit status 1

ERROR: cube-desktop-0.2-r0 do_rootfs: [log_check] cube-desktop: found 1 error message in the logfile:
[log_check] update-alternatives: Error: not linking .../tmp/work/genericx86_64-overc-linux/cube-desktop/0.2-r0/rootfs/usr/share/man/man8/syslogd.8 to /usr/share/man/man8/syslogd.8.inetutils since .../tmp/work/genericx86_64-overc-linux/cube-desktop/0.2-r0/rootfs/usr/share/man/man8/syslogd.8 exists and is not a link

---

I am looking into this now but wanted to raise this issue to keep others informed. Should the alternatives for docs be affected by this change or is this indicative of the fact that maybe they should be available as alternatives still?
Comment 7 Mark 2017-12-04 19:42:30 UTC
(In reply to comment #6)
> This seems to cause a conflict with inetutils in meta-networking. For
> example attempting to build an image which has both sysklogd and inetutils
> you will see:
> 
> ---
> 
> [log_check] warning: %post(inetutils-doc-1.9.4-r0.core2_64) scriptlet
> failed, exit status 1
> 
> ERROR: cube-desktop-0.2-r0 do_rootfs: [log_check] cube-desktop: found 1
> error message in the logfile:
> [log_check] update-alternatives: Error: not linking
> .../tmp/work/genericx86_64-overc-linux/cube-desktop/0.2-r0/rootfs/usr/share/
> man/man8/syslogd.8 to /usr/share/man/man8/syslogd.8.inetutils since
> .../tmp/work/genericx86_64-overc-linux/cube-desktop/0.2-r0/rootfs/usr/share/
> man/man8/syslogd.8 exists and is not a link
> 
> ---
> 
> I am looking into this now but wanted to raise this issue to keep others
> informed. Should the alternatives for docs be affected by this change or is
> this indicative of the fact that maybe they should be available as
> alternatives still?

Riffing on busybox-syslog and friends sending a patch to add the rconflicts for inetutils-syslogd addresses this.