diff options
author | Alexander Langer <alex@FreeBSD.org> | 2001-05-21 19:21:50 +0000 |
---|---|---|
committer | Alexander Langer <alex@FreeBSD.org> | 2001-05-21 19:21:50 +0000 |
commit | 6d58ff8fbd9b7aefaea15989d66e566b60f31c86 (patch) | |
tree | 7a4946eb4cbdef4acae0d5c893f4482d80a3ad2f /www/orion-devel/files | |
parent | upgrade to 0.4.11 (diff) |
From the PR:
The previous version of this port contains a bug in the orionctl script. I
didn't properly test it. This time I extensively tested it. It has also been
improved to detect more possible error conditions and exit gracefully in such
cases.
Bump PORTREVISION.
Update plist.
PR: 27501
Submitted by: maintainer
Notes
Notes:
svn path=/head/; revision=42877
Diffstat (limited to 'www/orion-devel/files')
-rw-r--r-- | www/orion-devel/files/orionctl | 54 |
1 files changed, 45 insertions, 9 deletions
diff --git a/www/orion-devel/files/orionctl b/www/orion-devel/files/orionctl index a8d258c30470..040da2d1bf47 100644 --- a/www/orion-devel/files/orionctl +++ b/www/orion-devel/files/orionctl @@ -4,23 +4,59 @@ if [ "${LOCALBASE}a" = "a" ]; then LOCALBASE=/usr/local fi -JAVA_HOME=${LOCALBASE}/linux-jdk1.2.2 -ORION_HOME=${LOCALBASE}/orion +NAME=orion +ORION_HOME=${LOCALBASE}/orion1.4.5 LOG=${ORION_HOME}/log/orion.log PID_FILE=/var/run/orion.pid +JAR_FILE=${ORION_HOME}/orion.jar + +if [ "${JAVA_HOME}a" = "a" ]; then + JAVA_HOME=${LOCALBASE}/linux-jdk1.3.0 +fi +JAVA_CMD=${JAVA_HOME}/bin/java + +# TODO: Check if we are being run at boot time right now + case "$1" in start) - if [ -r ${ORION_HOME}/orion.jar ]; then - rm -rf ${PID_FILE} - touch ${PID_FILE} - chown root:wheel ${PID_FILE} - chmod 600 ${PID_FILE} - echo -n ' orion' - ( cd ${ORION_HOME} && ${JAVA_HOME}/bin/java -jar orion.jar & echo $! > ${PID_FILE} ) > ${LOG} 2>&1 + # Make sure the Orion directory does exist + if [ ! -d ${ORION_HOME} ]; then + echo "" + echo "${NAME}: ERROR: Unable to find Orion home directory at ${ORION_HOME}." + exit 64 fi + + # Make sure the Orion JAR file exists + if [ ! -r ${JAR_FILE} ]; then + echo "" + echo "${NAME}: ERROR: Unable to find Orion JAR file at ${JAR_FILE}." + exit 64 + fi + + # Make sure the Java VM can be found + if [ ! -x ${JAVA_CMD} ]; then + echo "" + echo "${NAME}: ERROR: Unable to find Java VM at ${JAVA_HOME}." + exit 64 + fi + + # Create the process ID file + rm -rf ${PID_FILE} + touch ${PID_FILE} + chown root:wheel ${PID_FILE} + chmod 600 ${PID_FILE} + + echo -n ' orion' + ( cd ${ORION_HOME} && ${JAVA_CMD} -jar orion.jar & echo $! > ${PID_FILE} ) > ${LOG} 2>&1 ;; stop) + if [ ! -e ${PID_FILE} ]; then + echo "" + echo "${NAME}: ERROR: Unable to find Orion PID file at ${PID_FILE}." + exit 64 + fi + /bin/kill `cat ${PID_FILE}` echo -n ' orion' ;; |