Technical article 125909

Unixware 7.1.4 : OKP : OpenServer specific /etc/rc scripts in OKP are not executed by the UnixWare /etc/rc2.d/S99okprc script

UnixWare 7.1.3UnixWare 7.1.4

Written · Last revised

Problem

OpenServer specific rc scripts in OKP are not executed by the UnixWare S99okprc script.

Cause

There is a bug in the /etc/rc2.d/S99okrpc script that results in the script failing to detect the existence of OpenServer rc files in /openserver/etc/rc*.d.

Solution

The S99okprc script needs to be modified.  The following
if...fi statements are added to the script.

In the start section prior to the test for the existence of /openserver/$target add the following text:

if [ "`echo $target | cut -c -11`" = "/openserver" ]
then
    target="`echo $target | cut -c 12-`"
fi

In the stop section prior to the test for the existence of /openserver/$target add the following text:

if [ "`echo $target | cut -c -11`" = "/openserver" ]
then
    target="`echo $target | cut -c 12-`"
fi

A modifed copy of the entire script is included below:

<--- CUT HERE --->
#!/bin/sh
#
# Copyright (c) 2002 SCO, Inc. All Rights Reserved.
#
#        THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF
#                 SCO INTERNATIONAL INC.
#
#   The copyright notice above does not evidence any actual or intended
#   publication of such source code.
#
#ident  "%W%"
#ident  "$Header: $"
# Location of the file that lists the subsystems we want to bypass for
# rc.d script handling.
DONT_RUN_FILE="/etc/default/okprc"
# Check first for a functional OpenServer shell.  If there isn't one, then
# no further actions are possible.
eval 'openserver /bin/sh -c "exit 0" 2>&1 >/dev/null' 2>&1 >/dev/null
if [ $? -ne 0 ]
then
    exit 0
fi
# If there is a list file, read in the list of subsystems to suppress.
# The input file may contain blank lines, and comments (these are lines
# beginning with '#' characters).  If there's no list file, then we will
# suppress nothing.
dont_run=""
if [ -r "$DONT_RUN_FILE" ]
then
    dont_run=`
        while read line
        do
            # Ignore empty lines, and lines beginning with a '#'.
            echo "$line" | egrep -q "^[[:space:]]*$"
if [ $? -eq 0 ]; then
    continue;
fi
echo "$line" | egrep -q "^#"
if [ $? -eq 0 ]; then
    continue;
fi
            # Add the line's entry to our list.
            echo "$line"
        done <$DONT_RUN_FILE | tr '\n' ' '`
fi
# Handle start and stop arguments as normal for UNIX.
case "$1" in
    'start') # Process all files in OpenServer's etc/rc2.d.
        for file in /openserver/etc/rc2.d/S* /openserver/etc/rc2.d/P* \
                    /openserver/etc/rc2.d/I*
        do
            base=`basename $file`
if [ "$base" = 'S*' -o "$base" = 'P*' -o "$base" = 'I*' ]
then
    continue
fi
# Remove the leading S/P/I[0-9][0-9].
facility="`echo $base | cut -c4-`"
# Check the list for things we don't run.
echo " $dont_run " | egrep -q "[[:space:]]$facility[[:space:]]"
if [ $? -ne 0 ]
then
    # Not a listed file, so run it, bypassing links.  And
    # run it inside the OpenServer personality.
target=$file
if [ -h $file ]
then
    target="`ls -l $file | awk '{ print $NF }'`"
fi
if [ "`echo $target | cut -c -11`" = "/openserver" ]
then
    target="`echo $target | cut -c 12-`"
fi
        if [ -f /openserver/$target ]
        then
            openserver /bin/sh -c "/$target start" 2>&1
        fi
    fi
done
	;;
    'stop') # Process all files in OpenServer's etc/rc0.d.
	for file in /openserver/etc/rc0.d/K* /openserver/etc/rc2.d/P*
	do
            base=`basename $file`
if [ "$base" = 'K*' -o "$base" = 'P*' ]
then
    continue
fi
# Remove the leading K[0-9][0-9].
facility="`echo $base | cut -c4-`"
# Check the list for things we don't run.
echo " $dont_run " | egrep -q "[[:space:]]$facility[[:space:]]"
if [ $? -ne 0 ]
then
    # Not a listed file, so run it, bypassing links.  And
    # run it inside the OpenServer personality.
target=$file
if [ -h $file ]
then
    target="`ls -l $file | awk '{ print $NF }'`"
fi
if [ "`echo $target | cut -c -11`" = "/openserver" ]
then
    target="`echo $target | cut -c 12-`"
fi
if [ -f /openserver/$target ]
then
    openserver /bin/sh -c "/$target stop" 2>&1
fi
    fi
done
;;
*)  echo "Usage: $0 { start | stop }"
        ;;
esac
exit 0
<--- CUT HERE --->

From the Xinuos technical article database, record 125909. Reproduced with permission. The original is at www.sco.com/ta/125909, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.