Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I created a script called blueBoxT for starting and stopping Oracle and placed it in the /etc/init.d directory.

#!/bin/bash
echo "blueBoxT $1 - `date '+%Y%m%d%H%M'`" >> /root/blueBoxT.log
case "$1" in
  'start')
    echo "Starting Oracle"
    su - oracle -c "/home/oracle/startDBT"
    ;;
  'stop')
    echo "Stopping Oracle"
    su - oracle -c "/home/oracle/stopDBT"
    ;;
  *)
    echo "`basename $0`: usage: `basename $0` { stop | start }"
    ;;
esac
exit 0

I made the symbolic links as so...

root@dev /etc/rc.d
# find . -name *blueBox*
./rc2.d/K11blueBox
./rc6.d/K11blueBox
./init.d/blueBoxT
./rc1.d/K11blueBox
./rc3.d/S97blueBox
./rc0.d/K11blueBox
./rc5.d/S97blueBox
./rc4.d/S97blueBox

The log at /root/blueBoxT.log shows the start command and the Oracle instance is up.

The stop command never appears to get called. It is not in my log.

root@dev /root
# cat blueBoxT.log
blueBoxT start - 201008051323
blueBoxT start - 201008051327
blueBoxT start - 201008051346
blueBoxT start - 201008051356

I shutdown my Fedora 10 using the command...

shutdown -h now

What have I misconfigured to not be receiving the stop so that I can do an orderly shutdown of Oracle?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

I don't have that version of Fedora but for RHEL5 the important part of /etc/rc.d/rc is:

subsys=${i#/etc/rc$runlevel.d/K??}
[ -f /var/lock/subsys/$subsys -o -f /var/lock/subsys/$subsys.init ] \
        || continue

Your problem may be that you don't touch a /var/lock/subsys/blueBox when starting.

Also the file in init.d is called blueBoxT whereas your rc?.d scripts are called K??blueBox (no trailing T) which is confusing.

share|improve this answer
1  
K?? and S?? files in /rc?.d scripts are just symlinks back to the /etc/init.d script. They don't have to be named the same in fact due to the K??|S?? part they can't be named the same. –  Zypher Aug 5 '10 at 22:50
    
+1, make sure to touch the lock files –  James Aug 5 '10 at 22:50
    
I corrected the "missing T", but I don't think that was the problem. The lock seems to have done the trick! –  dacracot Aug 5 '10 at 23:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.