[LUNI] Getting the green "OK" on RH7.2
Jay Strauss
jjstrauss at yahoo.com
Thu Mar 28 13:58:01 CST 2002
Seva,
I don't really understand. If I comment out the "su", I get the "OK". That
is I'm still not using the /etc/init.d/functions
I'm not at the machine today so can't try anything, but I have some ideas to
try next time (i.e. just "su"ing without executing my script, and seeing
what happens)
Jay
----- Original Message -----
From: "Seva Epsteyn" <seva at sevatech.com>
To: <luni at luni.org>
Sent: Wednesday, March 27, 2002 12:57 PM
Subject: Re: [LUNI] Getting the green "OK" on RH7.2
> You need to use functions from /etc/init.d/functions in order for those to
> appear.
>
> For example at the top of all Red Hat init scripts you'll see
>
> # Source function library.
> . /etc/init.d/functions
>
> And when something is started they'll use the daemon function (defined
> above) such as:
>
> start() {
> echo -n $"Starting $prog: "
> daemon crond
>
> It's kind of tricky in your case though, since su would return success
even
> if dbstart might fail, so you'll need to use the --user= option to the
> daemon function..
>
> /Seva
>
> On Wed, 27 Mar 2002, Jay Strauss wrote:
>
> >I can't get the little green "OK" to show, during the start/stop of my
> >service (Oracle) when I boot/stop. The databases start and stop fine, I
> >just would like the "OK" to show up.
> >
> >The script "dbstart" produces some output, I think to stdout, since it
> >appears
> >on the screen (hence the redirect to /dev/null). The script is supplied
by
> >Oracle, and I can't prevent the output (probably could hack the script,
but
> >I'd prefer not to).
> >
> >Questions:
> >
> >1) I thought that as long as a script exits with a 0 I'd get an green
"OK"
> > when that service starts up.
> >
> >2) Could the fact that the dbstart script produces output be screwing
things
> >up
> >
> >3) What is the main script that runs during boot/shutdown that calls all
the
> > scripts in the rc.d directories (just out of curiosity)
> >
> >I'm running RH7.2,
> >here's the important bits
> >
> >#!/bin/bash
> >
> >start() {
> > echo -n 'Starting Oracle database(s): '
> > su - $ORA_OWNER -c "dbstart" /dev/null 2>&1
> > RETVAL=$?
> > echo
> > [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dbora
> > sleep 2
> > return $RETVAL
> >}
> >>
> >case "$1" in
> > start)
> > start
> > ;;
> > stop)
> > stop
> > ;;
> > *)
> > echo "Usage: dbora {start|stop}"
> > exit 1
> >esac
> >
> >exit $RETVAL
> >
> >
> >_________________________________________________________
> >Do You Yahoo!?
> >Get your free @yahoo.com address at http://mail.yahoo.com
> >
> >______________________________________________________________________
> >Linux Users Of Northern Illinois - Technical Discussion
> >luni at luni.org
> >http://luni.org/mailman/listinfo/luni
> >
>
> --
> seva at sevatech.com
> http://sevatech.com
>
> ______________________________________________________________________
> Linux Users Of Northern Illinois - Technical Discussion
> luni at luni.org
> http://luni.org/mailman/listinfo/luni
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
More information about the luni
mailing list