DB2: Unix Linux Startup Script

From Wiki
Revision as of 23:18, 5 February 2013 by Ebasso (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Versions

Version 1.0 (Current Version)

#! /bin/sh
########################################################################
# chkconfig: 345 98 16
# description: IBM DB2

### BEGIN INIT INFO
# Provides: rc_db2
# Required-Start: $remote_fs $syslog
# Required-Stop:  $remote_fs $syslog
# Default-Start:  3 5
# Default-Stop:   0 1 2 6
# Short-Description: IBM DB2 Linux Script version 20100622.01
# Author: Sasa Brkic (http://lsoy.posterous.com)
# Copyright (C) 2010 Creative Commons
# License: GNU GPL V2 or (at your option) any later version.
### END INIT INFO

########################################################################

case "$1" in
        start)
               echo -n "Starting IBM DB2: "
               su - db2admin -c db2start > /dev/null
       ;;
       stop)
               echo -n "Stopping IBM DB2: "
               su - db2admin -c db2stop > /dev/null
       ;;
       reload|restart)
               $0 stop
               $0 start
       ;;
       *)
               echo "Usage: $0 start|stop|restart|reload"
       exit 1
esac
exit 0

Ver também