*** empty log message ***
[csql.git] / scripts / startup.sh
blobb896235473f32527f92b3f4a12255daacfe9fc9b
1 #!/bin/sh
2 # Start CSQL Server
3 VERBOSE=$1
4 OS=`uname`
5 LOGFILE=`grep LOG_FILE $CSQL_CONFIG_FILE| tail -1 | awk -F"=" '{ print $2 }'`
6 LOGDIR=`dirname $LOGFILE`
8 TOTPROC=`ps -ef | grep csqlserver| wc -l`
9 if [ $TOTPROC -ne 1 ]
10 then
11 if [ "$OS" = "SunOS" ]
12 then
13 CSQLPID=`ps -ef | grep csqlserver |head -1| awk -F" " '{ print $2 }'`
14 else
15 CSQLPID=`ps -e | grep csqlserver |tail -1| awk -F" " '{ print $1 }'`
17 if [ "$CSQLPID" != "" ]
18 then
19 echo "Server Already running with PID $CSQLPID"
20 exit 0;
24 echo "CSQL Server Start: " + `date` >>$LOGDIR/csqlserver.log
25 if [ -z "$VERBOSE" ]
26 then
27 echo "Starting csqlserver without verbose"
28 nohup $CSQL_INSTALL_ROOT/bin/csqlserver >>$LOGDIR/csqlserver.log 2>>$LOGDIR/csqlserver.log &
29 sleep 2
30 else
31 echo "Start csqlserver with verbose"
32 $CSQL_INSTALL_ROOT/bin/csqlserver