#!/bin/sh ############################################################################## # # Copyright 2004 The Apache Software Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ############################################################################## ############################################################################## # # this bat file use the HXTT DBF Package for example; # if you use other HXTT Package,please modify the file # ############################################################################## JAVA_HOME=/usr/java/j2sdk1.5.0 DAEMON_HOME=/commondaemon HXTT_PACKAGE=/jdbclib/DBF_JDBC30.jar URLCONFIGPATH=/jdbclib/urlconfig.properties DAEMONPORT=8029 DAEMONPASSWORD=apassword #You can modify this user to a low right user,but you should copy the #urlconfig.properties file the low right user home directory which located #in the SERV_USER=root # for multi instances adapt those lines. TMP_DIR=/tmp PID_FILE=/var/run/jsvc.pid LOG_FILE=/tmp/jsvc.log CLASSPATH=$JAVA_HOME/lib/tools.jar:$DAEMON_HOME/commons-daemon.jar:$HXTT_PACKAGE case "$1" in start) # # Start JSVC SERVICE # $DAEMON_HOME/jsvc \ -user $SERV_USER \ -home $JAVA_HOME \ -Djava.io.tmpdir=$TMP_DIR \ -Dhxtt.urlconfig=$URLCONFIGPATH \ -Dhxtt.daemonport=$DAEMONPORT \ -Dhxtt.daemonpassword=$DAEMONPASSWORD \ -wait 10 \ -pidfile $PID_FILE \ -outfile $LOG_FILE \ -errfile '&1' \ -cp $CLASSPATH \ com.hxtt.sql.admin.HxttDaemon # # To get a verbose JVM #-verbose \ # To get a debug of jsvc. #-debug \ exit $? ;; stop) # # Stop JSVC # $DAEMON_HOME/dist/jsvc \ -home $JAVA_HOME \ -stop \ -pidfile $PID_FILE \ -outfile $LOG_FILE \ -errfile '&1' \ -Dhxtt.urlconfig=$URLCONFIGPATH \ -cp $CLASSPATH \ com.hxtt.sql.admin.HxttDaemon exit $? ;; *) echo "Usage hxttjsvcserv start/stop" exit 1;; esac