Find the answer to your Linux question:
Results 1 to 6 of 6
to start the Oracle DB and SAP(ERP), we did the following su - orabit bitesbitest:oracle> lsnrctl start bitest:oracle> exit and then su - bitadm bitest:bitadm> startsap I always did the ...
  1. #1
    Linux Newbie
    Join Date
    Feb 2007
    Posts
    248

    script to start service automatically

    to start the Oracle DB and SAP(ERP), we did the following

    su - orabit
    bitesbitest:oracle> lsnrctl start
    bitest:oracle> exit

    and then

    su - bitadm
    bitest:bitadm> startsap

    I always did the above manually, please share the code(script) that automatically does the above at each reboot.

    Regards

  2. #2
    Just Joined!
    Join Date
    Aug 2008
    Location
    Columbia, TN
    Posts
    14
    Put your commands in a script and name it whatever you want, that sounds like what it does. copy it to /etc/init.d .

    cd to a multiuser level directory, probably rc3.d so you kill it accidentally when/if shifting down a multi user mode.

    Make the symbolic link pointer to there. Choose an appropriate run number sequence. Look at all of the S and K script numbers and make yours after any prerequisite that your oracle requires.

    Be sure to make a proper K script pointer with the same number for shutdown.

    example: ln -s Existing NON-existing

    ln -s ../start_my_oracle S99start_my_oracle

  3. #3
    Linux Newbie
    Join Date
    Feb 2007
    Posts
    248
    nice help thanks

  4. #4
    Linux User
    Join Date
    May 2008
    Location
    NYC, moved from KS & MO
    Posts
    251
    Actually there are easier ways for this, what I usually do is, suppose I have a script ( it can also be a soft link to another script ) in /etc/init.d/myscript
    all I need to do is:
    Code:
    chkconfig -a myscript
    chkconfig myscript on
    If I don't need that script to run on boot, I simply do a
    Code:
    chkconfig myscript off
    chkconfig -d myscript
    If you need advanced control over what other service(s) should run before myscript, add the following information between the #!/bin/bash line and your actually codes, in this example, myscript requires network and portmap to run before itself does.

    Code:
    ### BEGIN INIT INFO
    # Provides:       myscript
    # Required-Start: $network $portmap
    # Required-Stop:
    # Default-Start:  3 5
    # Default-Stop:
    # Short-Description: whatever myscript does
    # Description:    longer description
    ### END INIT INFO
    A good place to learn more about this is to study scripts under /etc/init.d/

  5. #5
    Linux Newbie
    Join Date
    Feb 2007
    Posts
    248
    Hi secondmouse, excellent help.

    what's the difference b/w

    Required-Start: $network $portmap
    and
    Required-Start: network portmap

    that is whats difference b/w SERVICE and $SERVICE

  6. #6
    Linux User
    Join Date
    May 2008
    Location
    NYC, moved from KS & MO
    Posts
    251
    Quoted from /etc/init.d/skeleton
    When specifying hard dependencies or ordering requirements, you can
    # use names of services (contents of their Provides: section)
    # or pseudo names starting with a $.

Posting Permissions

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