Advertisement
Guest User

Untitled

a guest
May 26th, 2012
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. [root@oracle11 ~]# cat /etc/init.d/oracle
  2. #!/bin/bash
  3. # Oracle startup
  4. #
  5. # chkconfig: - 90 10
  6. # description: Simple Network Management Protocol (SNMP) Daemon
  7. #
  8.  
  9. ### BEGIN INIT INFO
  10. # Provides: oracle
  11. # Required-Start: $local_fs $network
  12. # Required-Stop: $local_fs $network
  13. # Should-Start:
  14. # Should-Stop:
  15. # Default-Start:
  16. # Default-Stop:
  17. # Short-Description: start and stop Net-SNMP daemon
  18. # Description: Simple Network Management Protocol (SNMP) Daemon
  19. ### END INIT INFO
  20.  
  21. # source function library
  22. . /etc/init.d/functions
  23.  
  24.  
  25. start() {
  26. su - oracle -c /home/oracle/bin/grace_start
  27. touch /var/lock/subsys/oracle
  28. return 0
  29. }
  30.  
  31. stop() {
  32. su - oracle -c /home/oracle/bin/grace_stop
  33. rm -f /var/lock/subsys/oracle
  34. return 0
  35. }
  36.  
  37. reload(){
  38. stop
  39. start
  40. }
  41.  
  42. restart(){
  43. stop
  44. start
  45. }
  46.  
  47. condrestart(){
  48. [ -e /var/lock/subsys/snmpd ] && restart
  49. return 0
  50. }
  51.  
  52. case "$1" in
  53. start)
  54. start
  55. RETVAL=$?
  56. ;;
  57. stop)
  58. stop
  59. RETVAL=$?
  60. ;;
  61. restart)
  62. restart
  63. RETVAL=$?
  64. ;;
  65. reload|force-reload)
  66. reload
  67. RETVAL=$?
  68. ;;
  69. condrestart|try-restart)
  70. condrestart
  71. RETVAL=$?
  72. ;;
  73. *)
  74. echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
  75. RETVAL=2
  76. esac
  77.  
  78. exit $RETVAL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement