LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 04-21-2004, 03:33 PM   #1
ilerdl
LQ Newbie
 
Registered: Apr 2004
Location: Cedar City, UT
Distribution: Redhat Enterprise 3 AS
Posts: 3

Rep: Reputation: 0
Redhat Ent 3 AS init.d won't shutdown db


I'm running Redhat Enterprise 3 AS on a Dell Optiplex G-270. All the latest updates have been applied.

I've constructed a script called /etc/init.d/suuce10 that starts up my Oracle db and shuts it down as per the usual init.d way.

Executed:
chkconfig --add suuce10
chkconfig --level 35 on
chkconfig --level 016 off

When the machine boots I see the message "Starting suuce10:", and everything works OK.

When I do an init 0|1|6 the stop portion of the script does not seem to execute. When I go into single user mode the db is still up and running fine. I'd like it shutdown at that point.

When I go to /etc/rc6.d and issue the command: ./K99suuce10 stop, then everything works fine. But, if Oracle is started and I reboot the maching no Oracle shutdown seems to happen.

No "Stopping suuce10:" message appears on shutdown/reboot.
"Startting suuce10:" does appear on startup.

I constructed a do nothing test program: /etc/init.d/test. It starts up but won't shut down.

Can anyone please H E L P. . .

file ownership is root.root and protection is 755

I've tried changing the relative numbers for K & S symbolic scripts.

As you probably know, Oracle won't let root effect startups and shutdowns. These have to be done by the oracle account owner, unless unusual provisions are made.

#!/bin/bash
#
# chkconfig: 35 99 99
# description: SUU db startup/shutdown script
#

start ()
{
su - oracle -c '/home/oracle/bin/cecms start'
su - oracle -c '/home/oracle/bin/oralistener start'
}

stop ()
{
su - oracle -c '/home/oracle/bin/cecms stop'
}


case "$1" in
start) start ;;
stop) stop ;;
esac

exit
 
Old 04-22-2004, 01:31 AM   #2
mrcheeks
Senior Member
 
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 52
look at init scripts in your init.d
they use conditions and echo messages "xxx" starting
 
Old 04-22-2004, 10:59 AM   #3
ilerdl
LQ Newbie
 
Registered: Apr 2004
Location: Cedar City, UT
Distribution: Redhat Enterprise 3 AS
Posts: 3

Original Poster
Rep: Reputation: 0
mrcheeks,

Thank you for your reply.

Yes, I saw the echo commands yesterday as I was grepping the /etc/init.d files. However, please keep in mind that I'm not asking how to get "Stopping suuce10:" to print on the screen, it is that suuce10 is NOT being executed to shutdown that component as the system changes run levels.

It's like Yule Brenner said in, The King And I, "Is a puzzlement!"

/etc/suuce10 runs from the command line without errors for both stop and start as $1.

The links are managed by chkconfig.

When booting the system I see "Starting suuce10:" whether or not I have echo commands in my init.d script. It works perfectly on the way up.

I've changed the K numbers again. I have one link named /etc/rc1.d/K60suuce10. When I do the following command it works perfectly.

/etc/rc1.d/K60suuce10 stop

But, when I do an init 1, and go to single user mode, I see no evidence that "suuce10 stop" is being executed. And indeed, if i grep my processes, it show that both Oracle and the listener are still active and running. This confirms that suuce10 did not run even though I've added echo commands to my script and have a working link in my rc1.d directory.

Is a puzzlement!

Do you s'pose this is a feature?????

What in the world am I doing wrong?

Help
 
Old 04-22-2004, 11:19 AM   #4
mrcheeks
Senior Member
 
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 52
i don't use redhat but in debian there is a command to do it : update-rc.d suuce.sh defaults, so their should be something like that for redhat/fedora check a man -k rc.d
 
Old 06-23-2009, 08:45 AM   #5
Darrel Earhart
LQ Newbie
 
Registered: Jun 2009
Posts: 1

Rep: Reputation: 0
Red Hat Linux (rhel 5) Oracle 10g shutdown/startup

Not sure of rhel3, but here's what I did to get Oracle to start up and shut down properly on Red Hat Enterprise Linux 5 (64bit) running selinux:

1. Place startup script (at bottom) in /etc/init.d, change perms accordingly

2. Ensure script has the chkconfig comments in it!

The numbers mean start oracle on init state 3, 4, and 5. Bring it up on order number 99, and down on order number 10

3. Run this to import startup into chkconfig:

# chkconfig --add dbora (the "dbora" needs to correspond to the startup script in /etc/init.d)

4. Run:

# chkconfig --list dbora (this shows what the startup/shutdown modes are set to, and should match the startup script)

5. Be sure to touch /var/lock/subsys/dbora every time system reboots to ensure stop routine is properly called

6. May need to inject sleep statements in the dbora script as the listener needs to be fully up before moving on (I put in sleeps between all start calls)

7. Note I used "runuser" instead of "su" - had to do this due to SELinux security


---------------
dbora:
---------------
#!/bin/sh

# chkconfig: 345 99 10
# description: Oracle 10g init script

ORACLE_HOME=opsw_db_home
ORACLE_OWNER=opsw_os_acct_name
ORACLE_SID=opsw_db_name

case "$1" in

'start')
echo "Starting Oracle 10g Database..."
touch /var/lock/subsys/dbora
chmod 644 /var/lock/subsys/dbora
chown root:root /var/lock/subsys/dbora
runuser - $ORACLE_OWNER -c "${ORACLE_HOME}/bin/lsnrctl start" &
runuser - $ORACLE_OWNER -c "${ORACLE_HOME}/bin/dbstart" &
runuser - $ORACLE_OWNER -c "${ORACLE_HOME}/bin/emctl start dbconsole" &
runuser - $ORACLE_OWNER -c "${ORACLE_HOME}/bin/isqlplusctl start" &
;;

'stop')
echo "Stopping Oracle 10g Database..."
runuser - $ORACLE_OWNER -c "${ORACLE_HOME}/bin/isqlplusctl stop" &
runuser - $ORACLE_OWNER -c "${ORACLE_HOME}/bin/emctl stop dbconsole" &
runuser - $ORACLE_OWNER -c "${ORACLE_HOME}/bin/lsnrctl stop" &
runuser - $ORACLE_OWNER -c "${ORACLE_HOME}/bin/dbshut"
;;

*)
echo $"Usage: $prog {start|stop}"
exit 1
esac

exit
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Redhat Ent 4 + rtl8139 = slow network Conspiracy13 Linux - Networking 0 10-27-2005 01:10 AM
IBM TOuchScreen on RedHat Ent. BraunFeldt Linux - Hardware 1 05-12-2005 06:39 AM
Redhat Ent 4 Installation cd's newlinfan Linux - Newbie 1 04-13-2005 10:28 AM
Any Software to access redhat ent linux from XP? kmlinux12 Linux - Software 5 09-25-2004 07:33 AM
mounting Solaris formatted drive on RedHat Ent v.3 steve7575 Linux - General 1 02-26-2004 05:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 09:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration