Init script not called during system shutdown

mark m.roth2006 at rcn.com
Tue Dec 9 14:38:07 UTC 2008


SIG - Pédagogie wrote:
> Hello,
> 
> I'm using an up-to-date Red Hat Enterprise Linux 4.7 (64 bits) system
> and I'd like to setup a startup/shutdown script to manage an Oracle AS
> 10g R2 installation.
> 
> The script works fine (start/stop/restart) when called from a bash
> prompt and it's launched at system startup with no problem.
> 
> The issue is that it's no called at all when the system shuts down, I
> checked runlevels, permissions for the script, I even put some "wall"
> and "echo" in it...
> 
Is there an /etc/rc[35].d/Kora-as1 ?

	mark
> I try different priorities, different script names, different shells,
> it's always the same. The only particularity of the script is that the
> commands I launch need to run under a user with no privileges, I use
> "su" for that.
> 
> (Once again, everything works when it's called from a shell, so doesn't
> seem to be "su"-related and the "wall" and "echo" command that should be
> exectued in root aren't executed)
> 
> I have absolutely no idea why this happens...
> 
> =========================================================================
> 
> # ls -l /etc/init.d/ora-as1
> -rwxr-xr-x  1 root root 617 Dec  9 14:45 /etc/init.d/ora-as1
> 
> =========================================================================
> 
> # cat /etc/init.d/ora-as1
> #!/bin/sh
> #
> # Startup script for Oracle AS 10g R2
> # chkconfig: 345 86 14
> #
> # description:  Bla bla bla
> 
> start() {
>         su -c "opmnctl startall" - ora-as1
>         su -c "emctl start iasconsole" - ora-as1
> }
> 
> stop() {
>         wall "Stopping ora-as1"
>         echo "`date` - Stopping ora-as1" >> /var/log/oracleas10gr2.log
>         su -c "emctl stop iasconsole" - ora-as1
>         su -c "opmnctl stopall" - ora-as1
> }
> 
> # See how we were called
> case "$1" in
>   start)
>         start
>         ;;
>   stop)
>         stop
>         ;;
>   restart)
>         stop
>         start
>         ;;
>   *)
>         echo "Usage: $0 {start|stop|restart}"
> esac
> 
> exit 0
> 
> =========================================================================
> 
> # find /etc/rc* -type l -name "*ora-as1*"
> /etc/rc.d/rc1.d/K14ora-as1
> /etc/rc.d/rc2.d/K14ora-as1
> /etc/rc.d/rc3.d/S86ora-as1
> /etc/rc.d/rc4.d/S86ora-as1
> /etc/rc.d/rc0.d/K14ora-as1
> /etc/rc.d/rc5.d/S86ora-as1
> /etc/rc.d/rc6.d/K14ora-as1
> 
> =========================================================================
> 
> # chkconfig --list ora-as1
> ora-as1         0:off   1:off   2:off   3:on    4:on    5:on    6:off
> 
> =========================================================================
> 
> Any idea?






More information about the redhat-list mailing list