I am trying to get some scripts set up to start / stop DB2, MQ and Websphere
applications. The scripts I have are in this format:
#! /bin/bash
set -x
case "$1" in
'start')
/bin/su - udbdb1 -c "/home/udbdb1/sqllib/adm/db2start"
;;
'stop')
/bin/su - udbdb1 -c "/home/udbdb1/sqllib/adm/db2stop"
;;
'restart')
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
;;
Esac
This is failing because the environment variables are not set up correctly
(-1390 reason 3 return code). Any suggestions on how to fix this?
I have found a way to initiate this with:
sudo -u udbdb1 -i /etc/init.d/db2 start
The problem with this is that I cannot find a way to implement this in the
/etc/sudoers file so a non-privileged user can run the command.
Any suggestions on how to make either of these methods work will be greatly
appreciated.
George Shedlock Jr
AEGON Information Technology
AEGON USA
502-560-3541
----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390