Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [root@oracle11 ~]# cat /etc/init.d/oracle
- #!/bin/bash
- # Oracle startup
- #
- # chkconfig: - 90 10
- # description: Simple Network Management Protocol (SNMP) Daemon
- #
- ### BEGIN INIT INFO
- # Provides: oracle
- # Required-Start: $local_fs $network
- # Required-Stop: $local_fs $network
- # Should-Start:
- # Should-Stop:
- # Default-Start:
- # Default-Stop:
- # Short-Description: start and stop Net-SNMP daemon
- # Description: Simple Network Management Protocol (SNMP) Daemon
- ### END INIT INFO
- # source function library
- . /etc/init.d/functions
- start() {
- su - oracle -c /home/oracle/bin/grace_start
- touch /var/lock/subsys/oracle
- return 0
- }
- stop() {
- su - oracle -c /home/oracle/bin/grace_stop
- rm -f /var/lock/subsys/oracle
- return 0
- }
- reload(){
- stop
- start
- }
- restart(){
- stop
- start
- }
- condrestart(){
- [ -e /var/lock/subsys/snmpd ] && restart
- return 0
- }
- case "$1" in
- start)
- start
- RETVAL=$?
- ;;
- stop)
- stop
- RETVAL=$?
- ;;
- restart)
- restart
- RETVAL=$?
- ;;
- reload|force-reload)
- reload
- RETVAL=$?
- ;;
- condrestart|try-restart)
- condrestart
- RETVAL=$?
- ;;
- *)
- echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
- RETVAL=2
- esac
- exit $RETVAL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement