Find the answer to your Linux question:
Results 1 to 5 of 5
Greetings, Not sure if this is the best forum to post this. What I have is a RedHat ES V4 server that's being set up as a Oracle Forms server. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User
    Join Date
    Jun 2007
    Posts
    318

    Script not being run during system startup


    Greetings,

    Not sure if this is the best forum to post this. What I have is a RedHat ES V4 server that's being set up as a Oracle Forms server. I have the following set up to start/stop the Oracle Forms:

    -rwxr-xr-- 1 root root 922 Feb 21 10:47 /etc/init.d/oracle_applications
    lrwxrwxrwx 1 root root 29 Feb 8 14:13 /etc/rc2.d/K99oracle_apps -> ../init.d/oracle_applications
    lrwxrwxrwx 1 root root 29 Feb 8 14:13 /etc/rc3.d/S98oracle_apps -> ../init.d/oracle_applications

    I can run the script manually and it works. Problem is the script doesn't run during system startup and I assume during system shutdown. The account is called ooracle with ksh as the shell plus the .profile prompts the user to enter an option of 1 or 2. So the script is set up to enter the appropriate option as follows:

    Code:
    #!/bin/sh
    case "$1" in
    
            start)
                    echo "Starting OEM Applications"
                    su -l ooracle  -c'/SYSO/u01o/app/oracle/product/FRS1012/opmn/bin/opmnctl startall'<<++EOT++
    1
    ++EOT++
                    su -l  ooracle -c'/SYSO/u01o/app/oracle/product/FRS1012/bin/emctl start iasconsole'<<++EOT++
    1
    ++EOT++
                    sleep 15
                    ;;
    
            stop)
                    echo "Stopping OEM Applications"
                    su -l  ooracle -c'/SYSO/u01o/app/oracle/product/FRS1012/bin/emctl stop iasconsole'<<++EOT++
    1
    ++EOT++
                     su -l ooracle  -c'/SYSO/u01o/app/oracle/product/FRS1012/opmn/bin/opmnctl stopall'<<++EOT++
    1
    ++EOT++
                    sleep 15
                    ;;
            status)
                    echo "Verifying OEM Applications"
                    su -l ooracle  -c'/SYSO/u01o/app/oracle/product/FRS1012/opmn/bin/opmnctl status'<<++EOT++
    1
    ++EOT++
                    ;;
            *)
                    echo "Usage: ora_apps  {start|stop|status}"
                    exit 1
                    ;;
    
    esac
    Any ideas why this won't work during system startup?

    Thanks,
    Vic

  2. #2
    Just Joined!
    Join Date
    Feb 2008
    Posts
    67
    Hi

    The setup shows that u should be able to run the script during startup because of the K and S files.
    Try this ... put it in /etc/rc.local as ./scriptname_withfullpath

  3. #3
    Linux User
    Join Date
    Jun 2007
    Posts
    318
    blade,

    Thanks for the info, I wasn't aware of that script. We did find the problem. RedHat Linux runs the scripts only for the runlevel being started to which in this case is level 5. So we set up a link for that level:

    /etc/rc5.d/S98oracle_apps -> ../init.d/oracle_applications

    That works.

    Thanks,
    Vic

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    for redhat based you can use chkconfig
    man chkconfig

  6. #5
    Linux User
    Join Date
    Jun 2007
    Posts
    318
    jledhead,

    Thanks for the info. Wasn't aware of that utility. Good to know.

    Vic

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •