Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
This line puts the path in the variable $portal_start
Then later in the script, you have this:
Code:
echo ">>> host name is -->" $host " and portal_start is -->" $portal_start
#
echo " ";
echo "-------------------------------------------------------";
dt=$(date +'%D %T')
echo $dt $host ">>> Start Portal <<<";
echo " ";
If you look at it carefully, you'll see you only have a few echo-commands.
Nothing is being executed; it just prints some text.
Try adding ths after the previous block of code:
Code:
$portal_start
This should try to execute the contents of the $portal_start variable, which contains the path to your WebSphere binary.
If the path, specified at the beginning of the script, is correct, it should start your server.
Here is the latest script:
{/}
#------------------> web_portal_start.sh <-------------------#
# #
# Modification log #
# ---------------- #
# #
# ------Please add new entries at the top. Be proud #
# | of your work. Comment it! #
# V #
# DATE WHO DESCRIPTION #
# ---- --- ----------- #
# 01/12/10 tst initial release to start portal #
# #
#-------------------------------------------------------------#
#!/bin/bash
set -x
host=$(hostname);
dt=$(date +'%D %T')
logfile='PortalUp.log'
profile_path='/opt/IBM/WebSphere/wp_profile'
#
#--> Determine which portal to use based on host name <--
#--> set portal1 for host name prd5, stg5, <--
# wprd5, tst5, <--
# wstg5 or dev2 <--
#
#--> set portal2 for host name prd6, stg6, <--
# wprd6, or tst6 <--
#
#portal_start='null';
#
if [ "$host" == "prd5" ] || [ "$host" == "stg5" ] ||
[ "$host" == "wprd5" ] || [ "$host" == "tst5" ] ||
[ "$host" == "wstg5" ] || [ "$host" == "dev2" ];
then
su -l admin -c /home/admin/scripts_PS/startportal & >> /tmp/weblog/$logfile
echo $dt start command for $server_name on $host Server has been issued. >> /tmp/weblog/$logfile
fi
# check every 3 minutes to see if server has been started. if server does not start in 30 minutes (10 checks), exit the script with
# return code 8
let "count = 0"
while [ $count -lt 11 ]
do
let "count = count +1"
#
dt=$(date +'%D %T')
#
if [ -f $profile_path/logs/$server_name/$server_name.pid ]; then
echo $dt $server_name on $host server has been successfully started. >> /tmp/weblog/$logfile
exit
#
else
echo $dt start process for $server_name on $host server is still running. checked $count times, 3 minutes apart >> /tmp/weblog/$logfile
sleep 180
fi
#
else
if [ "$host" == "prd6" ] || [ "$host" == "stg6" ] ||
[ "$host" == "wprd6" ] || [ "$host" == "tst6" ];
then
su -l admin -c /home/admin/scripts_PS/startportal_2 & >> /tmp/weblog/$logfile
echo $dt start command for $server_name on $host Server has been issued. >> /tmp/weblog/$logfile
fi
# check every 3 minutes to see if server has been started. if server does not start in 30 minutes (10 checks), exit the script with
# return code 8
let "count = 0"
while [ $count -lt 11 ]
do
let "count = count +1"
#
dt=$(date +'%D %T')
#
if [ -f $profile_path/logs/$server_name/$server_name.pid ]; then
echo $dt $server_name on $host server has been successfully started. >> /tmp/weblog/$logfile
exit
#
else
echo $dt start process for $server_name on $host server is still running. checked $count times, 3 minutes apart >> /tmp/weblog/$logfile
sleep 180
fi
done
#
dt=$(date +'%D %T')
echo $dt start process for $server_name on $host server DID NOT complete successfully. checked $count times, 3 minutes apart >> /tmp/weblog/$logfile
exit 8
#
{\}
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.