Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Showing results for 
Search instead for 
Did you mean: 

rc shut/start script problems

Frequent Advisor

rc shut/start script problems

hi all

we recently rebooted our rp8400 and the system
got stuck on the oracle startup script. right after the kernal was booting it started getting "stty ...." repeatedly. i rebooted in single user mode removed the links in /sbin/rc2.d for oracle startup and the system came up find. then i tested the oracle script in crontab and from a command line and it worked fine. so it must have been the rc links somehow. anybody have an easy way to to startup scripts for oracle on a standalone box

thx in advance
Honored Contributor

Re: rc shut/start script problems

If the oracle startup script in /sbin/init.d works from the command line (ie. /sbin/init.d/oracle start), then the issue may very well be when you start oracle during the boot process. Make sure the link is one of the last, if not the last, command issued at run level two (i.e. S999ORACLE) By having a lower number, you may have tried to start oracle before all of the subsytems were up.
Esteemed Contributor

Re: rc shut/start script problems

Please post your startup script.
Good things Just Got better (Plz,not stolen from advertisement -:) )
Frequent Advisor

Re: rc shut/start script problems


here is the script in /sbin/init.d. it calls another longer script. i just made a link to this in /sbin/rc2.d:

# Invoke the script to issue the commands as the
# Oracle user.

/usr/bin/su - oracle -c ${script}
Honored Contributor

Re: rc shut/start script problems

There is a template script in /sbin/init.d that can used to generate a start/stop script for oracle. copy /sbin/init.d/template to /sbin/init.d/oracle, and modify the appropriate portions for your app. You should always use a script based on the template whenever you want an app to start/stop wtih the system startup/shutdown
Devender Khatana
Honored Contributor

Re: rc shut/start script problems


Also keep the starting no. the last & stopping no. the first in its run level for proper functioning. This will start oracle in the end while machine boots & stop oracle first while shutting down.

The problem here seems due to not using the template file as indicated above.

Impossible itself mentions "I m possible"
A. Clay Stephenson
Acclaimed Contributor

Re: rc shut/start script problems

Part of your problem is the "su - oracle" rather than "su oracle". I know you want to use oracle's .profile but that is almost certainly the problem. The .profile contains command like tput, sttty, tabs, etc. which expect stdin to be a terminal. The better way todeal with this is to create a file, e.g. /usr/local/bin/ and set and export the environment there. Now both your rc'ed script AND oracle'. .profile should source (using the dot "." operator)
this file to set and export these variables.

This sourced file must not contain a return or exit statement.

Plan B.
Surround those commands in oracle' .profile with
if [[ -t 0 ]] # is stdin a tty device?
tset ...
stty ...
If it ain't broke, I can fix that.
Honored Contributor

Re: rc shut/start script problems


can you try this:
echo "/u01/app/oracle/product/8.1.7/bin/sqlplus /nolog <
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Valued Contributor

Re: rc shut/start script problems

hi Patti

Do the following steps:

step 1: edit /etc/oratab file

y -> for dbstart and dbshut scripts to startup and shutdoen the database

step 2: Create dbora script in the /etc/init.d

see attachment for the script

step 3: Create symbolic links to the dbora script in the appropriate run-level
script directories

# ln -s /etc/init.d/dbora /sbin/rc2.d/K10dbora
# ln -s /etc/init.d/dbora /sbin/rc3.d/S99dbora

step 4: avoidance of "stty is not a typewriter" error message

The not-a-typewriter error is caused by running commands where there is no
controlling tty device; that is, no interactive terminal is present. This would
be true for a script that runs in cron or has su - to run a batch job.

Uncomment all stty commands in /home/$ORA_OWNER/.profile as $ORA_OWNER
# Set up the terminal:
# if [ "$TERM" = "" ]
# then
# eval ` tset -s -Q -m ':?hp' `
# else
# eval ` tset -s -Q `
# fi
# stty erase "^H" kill "^U" intr "^C" eof "^D"
# stty hupcl ixon ixoff
# tabs

Recheck the scripts before applying...
Any suggestions warmly welcomed...

Good Luck !!

Vinod K