#!/bin/sh
# chkconfig: 2345 99 01
# processname:IBMDB2
# description:db2 start
DB2_HOME="/home/db2inst1/sqllib" #安装db2用户的sqllib
DB2_OWNER="db2inst1" #db2用户名
case "$1" in
start )
echo -n "starting IBM db2"
su - $DB2_OWNER -c $DB2_HOME/adm/db2start
touch /var/lock/db2
echo "ok"
;;
stop )
echo -n "shutdown IBM db2"
su - $DB2_OWNER -c $DB2_HOME/adm/db2stop
rm -f /var/lock/db2
echo "ok"
;;
restart|reload)
$0 stop
$0 start
;;
*)
echo "usage:$0 start|stop|restart|reload"
exit 1
esac
exit 0