FairCom Corporation
 
FairCom Start PageFairCom ProductsDownloadsDeveloper SupportSales InformationFairCom CustomersFairCom Company InformationContact FairCom

Homebulletgrey.gifeNewsletterbulletgrey.gifVolume 37bulletgrey.gifScripts for Easy c-treeACE Unix Startups


Quick and Easy c-treeACE Startup and Shutdown

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.

See Also

"It's really nice to know we chose the right product and company when we many years ago started using c-tree. There really wasn't much choice in those days on the Macintosh platform, but we couldn't have made a better choice. And now, when we are looking to port our applications to other platforms such as Mac OS X, Linux and Windows, c-tree is already there. Makes things so much easier for me."

Björn Lydeen
Software Developer, Montania System AB

FairCom Start PageSite MapContact FairComThe FairCom Privacy Policy Your Location: USA | Europe | Brazil | Japan
Copyright 2012 FairCom Corporation. All rights reserved.