Bug 936

Summary: alternatives errors during postinst processing
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Paul Eggleton <bluelightning>
Component: coreAssignee: Xiaofeng Yan <Xiaofeng.yan>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: liang.li2, liangliang.wang, meta.mr.watcher, meta.watcher, richard.purdie, scott.a.garman, sgw, yi.zhao
Version: 1.0   
Target Milestone: 1.1 M4   
Hardware: Beagleboard   
OS: arm   
Whiteboard: pulled request, waiting for merging by Aug12/2011
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Attachments:
Description Flags
boot log for beagleboard xm with 1.0 lsb-sdk image none

Description Paul Eggleton 2011-03-28 06:48:13 UTC
Created attachment 125 [details]
boot log for beagleboard xm with 1.0 lsb-sdk image

During postinst processing on the BeagleBoard on first bootup of the lsb-sdk image I get a number of messages indicating the command-line for update-alternatives may be incorrect (the help message is printed). The problem occurs within the postinst for "shadow" however when I run "sh /etc/rpm-postinsts/shadow.sh.done" manually it works fine.

Upon closer inspection I discovered there are actually two "update-alternatives" installed: one in /usr/sbin from chkconfig (symlinked to "alternatives"), and the other in /usr/bin from update-alternatives-cworth. It appears for whatever reason that the one from chkconfig is run during postinst processing but if you run the script from the command line it gets the other one; presumably this is due to differences in the PATH environment variable.

Surely only one of these needs to be installed...?
Comment 1 Richard Purdie 2011-03-31 04:16:46 UTC
The one from chkconfig should probably not be installed, the other is certainly the one we want.
Comment 2 Xiaofeng Yan 2011-08-09 03:15:47 UTC
inittab
  -->rcS
     -->./S40networking(PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin)
     -->S98configure(call rpm-postinstall)
  -->rc5.d
  -->profile(profile:4:PATH="/usr/local/bin:/usr/bin:/bin"
             profile:15:   PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin)
     

So as Paul said, this is due to differences in the PATH environment variable.
Comment 4 Yi Zhao 2011-08-26 02:14:41 UTC
Verified with 20110824 build. Only one "update-alternatives" is installed. 

###############
root@qemuarm:~# rpm -ql chkconfig
/etc
/etc/alternatives
/etc/chkconfig.d
/sbin
/sbin/chkconfig
/usr
/usr/sbin
/usr/sbin/alternatives
/usr/sbin/ntsysv
/var
/var/lib
/var/lib/alternatives

root@qemuarm:~# rpm -ql update-alternatives-cworth
/usr
/usr/bin
/usr/bin/update-alternatives
root@qemuarm:~# 
#############