"Carson, Chuck" wrote:

> I have the following startup/shutdown script:
>
> /etc/init.d/init_oracle
>
> /*START SCRIPT*/
> LOG=/var/oracle/init_oracle.log
> DATE=`/bin/date`
> SU=/bin/su
> RETVAL=0
>
> case "$1" in
> start)
>         echo -n "Starting Oracle Services..."
>         echo "${DATE}:startup" >> ${LOG}
>         ${SU} - oracle -c "/etc/init.d/oracle_start"
>         echo -n
>         ;;
> stop)
>         echo -n "Stopping Oracle Services..."
>         echo "${DATE}:shutdown" >> ${LOG}
>         ${SU} - oracle -c "/etc/init.d/oracle_stop"
>         echo -n
>         ;;
> *)
>         echo -n "Usage: $0 { start | stop }"
>         exit 1
>         ;;
> esac
>
> # Currently hardcoded pending more thorough error checking
> exit ${RETVAL}
> /*END SCRIPT*/
>
> This script works fine when starting up, that is, it gets started during the
> change into runlevel 5.
> /etc/rc5.d/S81init_oracle (sym link to /etc/init.d/init_oracle)
>
> However, it does not get called during reboot/shutdown. I have used reboot,
> init 0, and init 6 and none will cause this shutdown script to get executed.
> I have placed a symlink everywhere sendmail gets shutdown, I believe rc0.d,
> rc1.d, and rc6.d. The permissions on /etc/init.d/init_oracle are 755
> root:root, as is all other scripts in that directory. If I explicitly
> execute '/etc/init.d/init_oracle stop' in a shell it works fine.
>
> I log each time this script is run, either starting or stopping oracle, it
> starts fine but never get shutdown.
>
> BTW: These scripts, init_oracle, oracle_start, and oracle_stop, work fine on
> other linux boxes and solaris boxes so I know they work. (and also these
> scripts work when executed manually in a shell)

Could it be that the path to the shell is not there at boot?
All my scripts start with
#!/bin/sh
as the first line.

My guess is that all the other scenarios described are coming from an
established shell and the forked process inherits enough to make it run.

HTH

Bret




_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to