March 31, 2011
Scripts for Easy c-treeACE Unix Startups
Note: c-treeACE became FairCom DB in October 2020.
Unix and Linux users will appreciate the ready-to-use provided scripts to quickly start and stop the c‑treeACE database engine. Located in the outermost directory of your c‑treeACE installation, these platform specific scripts are within easy reach to immediately begin exploring all that c‑treeACE has to offer.
- ./startace — Sets up Java classpaths (if available) for stored procedure and triggers support and then starts the c‑treeACE database engine.
- ./stopace — Stops the c‑treeACE database engine via the ctstop command line utility.
A typical Linux script is as follows:
#!/bin/sh
echo Starting the c‑treeACE Database Engine...
cd bin/ace/sql
if [ -f /usr/java/jdk1.5.0_15/jre/lib/i386/server/libjvm.so ]; then
echo Found Java VM. Configuring Java support.
export CLASSPATH=/usr/java/jdk1.5.0_15/jre/lib/rt.jar:./classes/ctreeSQLSP.jar
export JVM_LIB=/usr/java/jdk1.5.0_15/jre/lib/i386/server/libjvm.so
export JAVA_COMPILER=/usr/java/jdk1.5.0_15/bin/javac
export LD_LIBRARY_PATH=/usr/java/jdk1.5.0_15/bin:.
else
echo Did not find Java VM. Starting without Java support.
export LD_LIBRARY_PATH=.
fi
nohup ./ctreesql 1> ctreesql.log 2> ctreesql.log &
Feel free to use these as your starting point to customize startup and shutdown functionality for your specific environments. For example, these scripts could easily be modified and added to an /etc/init.d script on Linux using the standard start-stop-daemon process.
depend() {
need net
before yourapp
provide ctreeace
}
start() {
ebegin "Starting ctreeACE server"
if [ -f /usr/java/jdk1.5.0_15/jre/lib/i386/server/libjvm.so ]; then
export CLASSPATH=/usr/java/jdk1.5.0_15/jre/lib/rt.jar:./classes/ctreeSQLSP.jar
export JVM_LIB=/usr/java/jdk1.5.0_15/jre/lib/i386/server/libjvm.so
export JAVA_COMPILER=/usr/java/jdk1.5.0_15/bin/javac
export LD_LIBRARY_PATH=/usr/java/jdk1.5.0_15/bin:.
else
export LD_LIBRARY_PATH=.
fi
eval start-stop-daemon --start --pidfile /var/run/ctreeace/ctreeace.pid --exec /usr/local/bin/ace/sql/ctreesql
eend $?
}
stop() {
ebegin "Stopping ldap-server"
start-stop-daemon --stop --signal 2 --quiet --pidfile /var/run/ctreeace/ctreeace.pid
eend $?
}
Just another feature of enhanced productivity with c‑treeACE V9.