io-net restart

Dear All,

I need to restart io-net on a QNX 6.1 standard installation.

I thought the right place to do it was /etc/rc.d/rc.local with the following
commands:

slay io-net
devp-pccard
io-net -dpci_nic -dpcmcia_nic -ptcpip

Unfortunately things do not work out because devp-pccard is not started yet
when io-net is called.

The build files use the command waitfor /dev/pccard, but the command is not
available for the shell

By digging in the help, I found the “waitfor” can be used in the enumerator
files.

Is it wise to modify them ? Would you suggest an other approach ?

Thanks,

Andrea.

I’m using the 6.2 beta – hope my ideas will help you with 6.1. There are a
couple of quick ways to get “waitfor” working in a shell script.

  1. There appears to be a “waitfor” util in /bin:
    node51$ file /bin/waitfor
    /bin/waitfor: symbolic link to on

  2. There appears to be a “waitfor” ksh function in rc.sysinit:
    node51$ grep waitfor /etc/rc.d/rc.sysinit
    function waitfor {

  3. The “on” util can also give you the same feature:
    node51$ on -W 10 -w /dev/pccard true


    Andrea Borsic <aborsic@brookes.ac.uk> wrote:

Dear All,

I need to restart io-net on a QNX 6.1 standard installation.

I thought the right place to do it was /etc/rc.d/rc.local with the following
commands:

slay io-net
devp-pccard
io-net -dpci_nic -dpcmcia_nic -ptcpip

Unfortunately things do not work out because devp-pccard is not started yet
when io-net is called.

The build files use the command waitfor /dev/pccard, but the command is not
available for the shell

By digging in the help, I found the “waitfor” can be used in the enumerator
files.

Is it wise to modify them ? Would you suggest an other approach ?

Thanks,

Andrea.


Kirk Russell Bridlewood Software Testers Guild

‘waitfor’ is function declared in /etc/rc.d/sysinit

A usefull function

function waitfor {
typeset -i i=0
while test $i -lt 60 -a ! $1 -ef $1 ; do
sleep 1;
let i=i+1;
done
unset i
}


dmi


I’m using the 6.2 beta – hope my ideas will help you with 6.1. There are a
couple of quick ways to get “waitfor” working in a shell script.

  1. There appears to be a “waitfor” util in /bin:
    node51$ file /bin/waitfor
    /bin/waitfor: symbolic link to on

  2. There appears to be a “waitfor” ksh function in rc.sysinit:
    node51$ grep waitfor /etc/rc.d/rc.sysinit
    function waitfor {

  3. The “on” util can also give you the same feature:
    node51$ on -W 10 -w /dev/pccard true

Andrea Borsic <> aborsic@brookes.ac.uk> > wrote:
Dear All,

I need to restart io-net on a QNX 6.1 standard installation.

I thought the right place to do it was /etc/rc.d/rc.local with the following
commands:

slay io-net
devp-pccard
io-net -dpci_nic -dpcmcia_nic -ptcpip

Unfortunately things do not work out because devp-pccard is not started yet
when io-net is called.

The build files use the command waitfor /dev/pccard, but the command is not
available for the shell

By digging in the help, I found the “waitfor” can be used in the enumerator
files.

Is it wise to modify them ? Would you suggest an other approach ?

Thanks,

Andrea.


Kirk Russell Bridlewood Software Testers Guild

Dear Kirk and Dimitry,

Thanks for the useful infomation,

Andrea.

Hi,

I want script which executes on EVERY machine
and (re)starts io-net
AFAIK, enum-devices script always starts some device drivers
(such as io-audio,io-graphics etc) although its were loaded.
And i wrote the following script. This script allows does not load some
drivers again.
But, may be exist some another better solution?

#!/bin/sh
#set -x

This script should be used to load io-net.

It allows for io-net to load appropriate hardware drivers.

In general this script is used in debugging purposes when it is need

to unload/load io-net offen.

MYFULLNAME=fullpath $0
WORK_DIR=dirname $MYFULLNAME
#WORK_DIR=/tmp

#VERBOSE=-v
FORCE_LINK=0
FORCE_UNLOAD=0
CURPWD=$PWD

trapper()
{
cd $CURPWD
}

if [ basename $0 != “ionet-start-install” ] ;then
echo “This script should be started in different session.”
exit 0
fi

if [ id -u -ne 0 -o id -g -ne 0 ] ;then
echo “You should be superuser. Exiting.”
exit 1
fi

link()
{
cp -rncf $VERBOSE /etc/system/enum . 2>/dev/null
for x in find /etc/system/enum -name "*" ; do
if [ ! -d $x ] ;then
case basename $x in
audio | char | input | block | graph | serial | print )
;;

  • )
    ln -sf $x ./echo $x | sed "s/\/etc\/system\///"
    ;;
    esac
    fi
    done
    }

ac_prev=
for ac_option
do

If the previous option needs an argument, assign it.

if test -n “$ac_prev”; then
eval “$ac_prev=$ac_option”
ac_prev=
continue
fi
#echo $ac_option
case “$ac_option” in
-=) ac_optarg=echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//' ;;
) ;;
esac
echo opt:$ac_option optarg:$ac_optarg
case “$ac_option” in
-force-link) FORCE_LINK=1;;
-force-unload) FORCE_UNLOAD=1;;
-verbose) VERBOSE=-v;;
-test-only) TEST_ONLY=-n;;
-work-dir=
) WORK_DIR=$ac_optarg;;
-= | -* | *)
cat << EOF
Usage: $0 [options]
Options: [defaults in brackets after descriptions]
-force-link [$FORCE_LINK]
-force-unload [$FORCE_UNLOAD]
-verbose []
EOF
exit 1;;
esac
done

trap trapper EXIT
#trap trapper SIGINT
#trap trapper ERR
cd $WORK_DIR

if [ $FORCE_LINK -eq 0 ] ;then
if [ ! -f enum/common ] ;then
link
#echo enum/common already exist.
#exit 0
fi
else
link
fi

ionet_reopen_if_need()
{
#slay -f $VERBOSE mrouted
#ionetlist=sin -Pio-net
ionetlist=ps -A|grep io-net|awk '{print $1}'
if [ $? = 0 ] ;then
ionets=echo $ionetlist | wc -w
if [ $ionets -eq 0 -o $ionets -gt 1 ] ;then
enum-devices $TEST_ONLY $VERBOSE -c ./enum/common
else
if [ “pidin -p $ionetlist mem | grep pktmgr” != “” ] ;then

if [ “sin -Pio-net mem|grep pktmgr” != “” ] ; then

enum-devices $TEST_ONLY $VERBOSE -c ./enum/common

else #may be: check io-net env for CAOS_CVMCFGPATH

fi
fi
else
enum-devices $TEST_ONLY $VERBOSE -c ./enum/common
fi
}

if [ $FORCE_UNLOAD -ne 0 ] ;then
slay -f $VERBOSE io-net mrouted inetd
sleep 1
fi

PATH=$PATH:/sbin
enum-devices $TEST_ONLY $VERBOSE -c ./enum/common 2>/dev/null
ionet_reopen_if_need

#Now You can run the following w/o ‘n’ option:

# enum-devices -c ./enum/common


\

Best regards,
vasa mailto:vasilii@cambira.com


“Andrea Borsic” <aborsic@brookes.ac.uk> wrote in message
news:a2rq86$kgk$1@inn.qnx.com

Dear All,

I need to restart io-net on a QNX 6.1 standard installation.

I thought the right place to do it was /etc/rc.d/rc.local with the
following
commands:

slay io-net
devp-pccard
io-net -dpci_nic -dpcmcia_nic -ptcpip

Unfortunately things do not work out because devp-pccard is not started
yet
when io-net is called.

The build files use the command waitfor /dev/pccard, but the command is
not
available for the shell

By digging in the help, I found the “waitfor” can be used in the
enumerator
files.

Is it wise to modify them ? Would you suggest an other approach ?

Thanks,

Andrea.