Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to set websphere to start during reboot using "wasadmin" user ?

Status
Not open for further replies.

hrp2010

MIS
May 16, 2007
15
US
following are the contents of was-start script which i am running it manually once server is fully up after reboot. but i wanted to auto start this " was-start " script using " wasadmin " user . Anyone can help me on this ??

was-start script
-------------------
#!/bin/sh

# add new server anme onto the ServerList below. Make you add a space between each server name
Server=server1

#=============== DO NOT CHANGE ANY CODE BELOW ===================

WS_ROOTDIR="/opt/IBM/WebSphere/AppServer"
WS_DIR="$WS_ROOTDIR/profiles/AppSrv01/bin"

. $WS_DIR/dj_params.sh

if [ $USERNAME != "wasadmin" ]
then
echo ""
echo "Must login as wasadmin"
echo ""
exit 1;
fi

if [ -z "$ROOTDIR" -o ! -d "$ROOTDIR" ]
then
echo "ERROR: ROOTDIR=[$ROOTDIR] is empty or invalid"
exit 1
fi

echo "start server :==========> $Server"
$WS_DIR/startServer.sh $Server

sleep 2

echo ""
echo "Checking for any WebSphere process is still running"
ps -ef | grep "$ROOTDIR"
echo ""
echo "Total WebSphere proccesses are currently running"
ps -ef| grep "$ROOTDIR"| grep -v grep | wc -l

exit 0

--------------------
end script

------------------------
 
What version of WebSphere are you using? Have you looked into "Run as user", you can start up WebSphere using the root user, and then the java process will run as the designated user. Search the IBM site for iformation dealing with your specific version of WebSphere.

Good luck,

Einstein47
For best results: hand wash in cold, tumble dry low.
For not so good results: drag through puddles, pound on rocks, air dry on tree branch.
[[]Starbase47.com]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top