tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* Need help running a script at boot...
@ 1995-11-16 19:08 Edward C. Bailey
  0 siblings, 0 replies; only message in thread
From: Edward C. Bailey @ 1995-11-16 19:08 UTC (permalink / raw)
  To: tru64-unix-managers

Hello,

    I have a problem.  We have a 2100 running OSF/1 3.0, and are trying to
start mSQL, which is a public-domain SQL implementation, at boot time.
Here's what we have:

In /sbin/rc3.d/S99msqld:

#!/bin/sh
echo "Starting msqld..."
/usr/local/Minerva/run_daemon msqld

As you can see, there's not much there.  As you'll be able to see from
run_daemon below, this script will never return, and would therefore hang
the boot process.  This is where I came in (I've inherited this problem as
the original perpetrator has since gone on to greener pastures).  My first
attempt was to simply put a "&" at the end of the invocation of
run_daemon.  This permitted the boot to complete normally, but the job
running run_daemon was gone - it should have hung around, re-running msqld
as necessary.

    I've tried just about everything I can think of to get this to work,
and have come up dry.  I figure it's either something so stupid I'll be
banging my head on the desk, so I thought who better to be humiliated by
than this list! :-)

    In any case, any insights would be greatly appreciated...

                                Ed

P.S. the script run_daemon referenced above follows...

P.P.S. I get an empty "output" file from the line that runs the daemon.
I've added echos into a trace file, and find that run_daemon does execute,
right up to the line that runs the daemon.  By the time I log in, there is
no daemon, and no run_daemon job...

In /usr/local/Minerva/run_daemon:

#!/bin/sh
#
# Because this stuff is still pretty young, you may wish to run the
# server using this script.  It'll notify if the server crashes and
# restart it after a couple of minutes.  It also puts the core in a known
# place and mails you any output generated by the terminal process.
#
# run it as  'run_daemon msqld' to run the mSQL engine.
#
#                                       bambi@Bond.edu.au

INST_DIR=/usr/local/Minerva
ADMIN="root"
PROG=$1

if test ! -d "${INST_DIR}/debug"
then
        mkdir ${INST_DIR}/debug
fi

if test ! -d "${INST_DIR}/debug/${PROG}"
then
        mkdir ${INST_DIR}/debug/${PROG}
fi

while :
do
        cd ${INST_DIR}/debug/${PROG}
        ${INST_DIR}/bin/${PROG} > output 2>&1
        echo "Program : ${PROG}
Time : `date`
Program Output
--------------

" > mail.tmp
        cat output >> mail.tmp
        Mail -s "Minerva Daemon Crash Report" ${ADMIN} < mail.tmp
        sleep 15
done
-- 
Ed Bailey, Information Systems and Networks
(contracted to: National Institute of Environmental Health Sciences)
2327 Englert Drive.
Suite 200
Durham, NC 27713
                              
 Internet: bailey@niehs.nih.gov
   BITnet: BAILEY@NIEHS.BITNET 
    Voice: (919)361-9422, extension 239
      FAX: (919)544-6642

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1995-11-16 19:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-11-16 19:08 Need help running a script at boot Edward C. Bailey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox