Wind River Support Network

HomeDefectsLIN6-9587
Fixed

LIN6-9587 : wrlinux 6 - faulty usermode shutdown

Created: Mar 16, 2015    Updated: Dec 3, 2018
Resolved Date: Mar 29, 2015
Found In Version: 6.0.0.17
Fix Version: 6.0.0.19
Severity: Standard
Applicable for: Wind River Linux 6
Component/s: Userspace

Description

the usermode package provides a wrapper shutdown script which calls the halt binary from an incorrect location:

/usr/bin/halt instead of the real location /sbin/halt

Steps to Reproduce

project1 :
/WRL_60x_CGP_LATEST/wrlinux-6/wrlinux/configure --enable-reconfig=yes --enable-board=intel-x86-64 --enable-kernel=standard --enable-rootfs=glibc-small+installer-support --enable-bootimage=ext3 --enable-rm-oldimgs=yes --with-sstate-dir=../../intel-x86-64-sstate/ --enable-jobs=8 --enable-parallel-pkgbuilds=8 --with-rcpl-version=0017
make fs

project2
/WRL_60x_CGP_LATEST/wrlinux-6/wrlinux/configure --enable-reconfig=yes --enable-board=intel-x86-64 --enable-kernel=standard --enable-rootfs=wr-installer --enable-target-installer=yes --enable-bootimage=iso --with-installer-target-build=/workspace/shutdown_prjs/prj2/../prj1/export/intel-x86-64-glibc-small-standard-dist.ext3 --enable-rm-oldimgs=yes --enable-jobs=8 --enable-parallel-pkgbuilds=8 --with-rcpl-version=0017
-bash-4.1$
make fs

find export/dist -name shutdown
export/dist/var/lib/opkg/alternatives/shutdown
export/dist/sbin/shutdown
export/dist/usr/bin/shutdown

cat export/dist/usr/bin/shutdown
#!/bin/sh
# Try to do the right thing for programs that rely on "/usr/bin/shutdown -r now"
# to shut down the machine.
prog=/sbin/shutdown
now=
for flag in $* ; do
    if test ${flag} = "-h" ; then
        prog=/usr/bin/halt
    elif test ${flag} = "-r" ; then
        prog=/usr/bin/reboot
    elif test ${flag} = "now" ; then
        now=$flag
    else
        args="$args $flag"
done
if [ -z "$args" -a $prog != /sbin/shutdown ] ; then
    exec $prog $args
else
    exec /sbin/shutdown $args $now 

Other Downloads


Live chat
Online