Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

chkconfig not working on OEL 5.7 (services are not stopped during reboot)

Andrea MDec 6 2011 — edited Dec 6 2011
Hi all,

I am trying to use chkconfig to configure a "service" on Oracle Linux 5.7 .
I noticed that the script is called during system boot with the "start" option, but it is not called during system shutdown !

The script is:

[root@srv-db5 ~]# cat /etc/init.d/oradb
#!/bin/bash
#
# chkconfig: 35 99 10
# description: Starts and stops Oracle processes
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
#
ORA_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
ORA_OWNER=oracle

case "$1" in
'start')
/bin/echo "" >> /tmp/oradb.log 2>&1
/bin/echo "$0 start - `/bin/date` " >> /tmp/oradb.log 2>&1
touch /var/lock/subsys/dbora
;;
'stop')
/bin/echo "$0 stop - `/bin/date` " >> /tmp/oradb.log 2>&1
/bin/echo "" >> /tmp/oradb.log 2>&1
rm -f /var/lock/subsys/dbora
;;
esac
# End of script oradb




chkconfig can read it:

[root@srv-db5 ~]# chkconfig --add oradb
[root@srv-db5 ~]# chkconfig --list oradb
oradb 0:off 1:off 2:off 3:on 4:off 5:on 6:off
[root@srv-db5 ~]#


and chkconfig creates all the expected symlinks :

[root@srv-db5 ~]# find /etc/ -type l -iname "*oradb*" -exec ls -l \{} \; | sort
lrwxrwxrwx 1 root root 15 Dec 6 11:51 /etc/rc.d/rc0.d/K10oradb -> ../init.d/oradb
lrwxrwxrwx 1 root root 15 Dec 6 11:51 /etc/rc.d/rc1.d/K10oradb -> ../init.d/oradb
lrwxrwxrwx 1 root root 15 Dec 6 11:51 /etc/rc.d/rc2.d/K10oradb -> ../init.d/oradb
lrwxrwxrwx 1 root root 15 Dec 6 11:51 /etc/rc.d/rc3.d/S99oradb -> ../init.d/oradb
lrwxrwxrwx 1 root root 15 Dec 6 11:51 /etc/rc.d/rc4.d/K10oradb -> ../init.d/oradb
lrwxrwxrwx 1 root root 15 Dec 6 11:51 /etc/rc.d/rc5.d/S99oradb -> ../init.d/oradb
lrwxrwxrwx 1 root root 15 Dec 6 11:51 /etc/rc.d/rc6.d/K10oradb -> ../init.d/oradb



if Itry to manually issue "service oradb start | stop " everything works fine:

[root@srv-db5 ~]# > /tmp/oradb.log
[root@srv-db5 ~]# service oradb start
[root@srv-db5 ~]# cat /tmp/oradb.log

/etc/init.d/oradb start - Tue Dec 6 12:01:14 CET 2011
[root@srv-db5 ~]# service oradb stop
[root@srv-db5 ~]# cat /tmp/oradb.log

/etc/init.d/oradb start - Tue Dec 6 12:01:14 CET 2011
/etc/init.d/oradb stop - Tue Dec 6 12:01:23 CET 2011





but if I do a reboot, I see that my script has not been called during system shutdown :


[root@srv-db5 ~]#
[root@srv-db5 ~]# cat /tmp/oradb.log

/etc/init.d/oradb start - Tue Dec 6 12:01:14 CET 2011
/etc/init.d/oradb stop - Tue Dec 6 12:01:23 CET 2011


/etc/rc5.d/S99oradb start - Tue Dec 6 12:03:50 CET 2011
[root@srv-db5 ~]#
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 3 2012
Added on Dec 6 2011
1 comment
648 views