[Orca-dev] Re: Orca_services orca_services.cfg

Sjaak Westdijk westdijk at fastmail.fm
Sun Mar 9 02:57:49 PST 2003


Hi,

Yep, here it is. We talked about the use of gawk and in this case about
the ps command. We can't be sure that /usr/ucb/sparcv9/ps is installed.

   Sjaak

On Sat, 8 Mar 2003, Sean O'Neill wrote:

> At 03:17 PM 3/8/2003 -0600, Sean O'Neill wrote:
>
> >>- in the start_orca_services.sh you changed back the solaris ps
> >>command,   is this done with a reason ?
> >
> >Not sure what you mean here.  I didn't modify the ps command in this
> >file.  The block of code for the PS command is the same as it is in the
> >files you sent me.
>
> Sorry, I found an email with a thread indicating we had a discussion about
> this.  Unfortunately, I lost the email in which I think you sent me some
> updated code.  Can you resend your updated start_orca_services please ?
>
>
> --
> ........................................................
> ......... ..- -. .. -..- .-. ..- .-.. . ... ............
> .-- .. -. -... .-.. --- .-- ... -.. .-. --- --- .-.. ...
>
> Sean O'Neill
>
>
>


-----------------------------------------------------------------------------
Sjaak Westdijk              westdijk at fastmail.fm
---==               Sent via Pine 4.5 Running on Solaris9               ==---
-------------- next part --------------
#!/bin/sh

# This script runs orca_services with the proper options for your site.

# Define program locations that will be needed.
prefix=/opt/SWorca
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
AWK=/usr/bin/awk
CUT=/usr/bin/cut
UNAME=/usr/bin/uname
ORCA_SERVICES_DIR=/opt/SWorca/var/orca/orca_services

# Get the hostname without the fully qualified part; that is, trim off
# anything past the first `.'.
uname=`$UNAME -n | $CUT -d. -f1`

OPERSYS=`$UNAME -s`
if test "${OPERSYS}" = "Linux"; then
    PSCMD="/bin/ps auxww"
else
    PSCMD="/usr/bin/ps -ef" # Solaris
fi

# The directory these files go into is $ORCA_SERVICES_DIR/HOSTNAME
OUTDIR=$ORCA_SERVICES_DIR/$uname

# Export the environmental variables.
export OUTDIR

# Check if orca_services is already running.
pids=`$PSCMD | $AWK '/orca_services/ && !/awk/ && !/start_orca_services/ && !/daemon/ && !/ \/etc\/init\.d/ && !/ \/etc\/rc/ {print $2}'`
if test "$pids" != ""; then
  echo "Orca_Services already running.  Exiting."
  exit 1
fi

echo "Writing data into $OUTDIR/"

# Cd to / so that any automounted filesystems can be unmounted.
cd /

# Create the output directory if it doesn't exist yet.
if test ! -d $OUTDIR; then
  echo "Creating $OUTDIR/"
  mkdir -p $OUTDIR
fi

if test ! -d $OUTDIR; then
  echo "Unable to create $OUTDIR/" 1>&2
  exit 2
fi

# Now start the logging.
echo "Starting logging"
HOSTNAME=`hostname`
if test -f "$libdir/orca_services.$HOSTNAME"; then
    $libdir/orca_services `cat $libdir/orca_services.$HOSTNAME`
else
    $libdir/orca_services
fi

### # Write the PID of orca_services to a file to make killing easier.
### pid=$!
### echo $pid > $OUTDIR/orca_services.pid

# Sleep for a couple of seconds to allow any orca_services warnings to appear.
sleep 5


More information about the Orca-dev mailing list