Linux system settings DB2 and other services boot process

  
                

In the Linux system, to set the boot, it is necessary to implement it through code. By writing a script to add the service to the Linux boot entry, this article will introduce the process of setting up DB2 and other services in the Linux system.

1. Go to the /etc/init.d directory.

Executing as root

Shell code

cd /etc/init.d

2. Writing DB2 startup scripts

Shell Code

vi startDB2

Enter the following

Shell Code

#! /bin/sh

# chkconfig: 2345 99 01

# processname:IBMDB2

# description:db2 start

DB2_HOME=“/home/Db2inst1/sqllib” #Install db2 user's sqllib

DB2_OWNER=“db2inst1” #db2username

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

Copyright © Windows knowledge All Rights Reserved