diff options
author | Maxim Sobolev <sobomax@FreeBSD.org> | 2001-06-12 10:20:48 +0000 |
---|---|---|
committer | Maxim Sobolev <sobomax@FreeBSD.org> | 2001-06-12 10:20:48 +0000 |
commit | 1aa47310cad868fcb7479d27d86d810b5f9f16a9 (patch) | |
tree | 1777fe136f7d2376333810328cc10bd113261020 /java | |
parent | 043fe06cfd43ca8cda54b1aa2b204991e769c64e (diff) | |
download | ports-1aa47310cad868fcb7479d27d86d810b5f9f16a9.tar.gz ports-1aa47310cad868fcb7479d27d86d810b5f9f16a9.zip |
Several fixes and improvements:
- Now installing a man page for 'orionctl'.
- Correctly stopping Orion and removing the PID file on deinstall.
- Verbose install (removed the @-signs).
- Changes the exit codes in the script (and documented them in the man page)
- Extended the documentation in pkg-descr.
PR: 27748
Submitted by: maintainer
Notes
Notes:
svn path=/head/; revision=43888
Diffstat (limited to 'java')
-rw-r--r-- | java/orion/Makefile | 25 | ||||
-rw-r--r-- | java/orion/files/orionctl | 13 | ||||
-rw-r--r-- | java/orion/files/orionctl.1 | 96 | ||||
-rw-r--r-- | java/orion/pkg-deinstall | 8 | ||||
-rw-r--r-- | java/orion/pkg-descr | 6 |
5 files changed, 131 insertions, 17 deletions
diff --git a/java/orion/Makefile b/java/orion/Makefile index 0688992606e2..c0c35c75976e 100644 --- a/java/orion/Makefile +++ b/java/orion/Makefile @@ -7,7 +7,7 @@ PORTNAME= orion PORTVERSION= 1.4.5 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= java www MASTER_SITES= ftp://ftp.sunet.se/pub/database/utils/orionserver/ \ ${MASTER_SITE_LOCAL} \ @@ -36,22 +36,27 @@ TARGET_PREFIX?= ${PREFIX}/${PKGBASE}${PORTVERSION} .include <bsd.port.pre.mk> do-install: - @${MKDIR} ${ORION_HOME} - @${CP} -R ${WRKSRC}/* ${ORION_HOME} - @${CHMOD} 755 `find ${ORION_HOME} -type d` - @${CAT} ${FILESDIR}/${ORIONCTL_NAME} \ + ${MKDIR} ${ORION_HOME} + ${CP} -R ${WRKSRC}/* ${ORION_HOME} + ${CHMOD} 755 `find ${ORION_HOME} -type d` + ${CAT} ${FILESDIR}/${ORIONCTL_NAME} \ | ${SED} "/%%PORTNAME%%/s//${PORTNAME}/" \ | ${SED} "/%%PORTVERSION%%/s//${PORTVERSION}/" \ | ${SED} "/%%ORION_HOME%%/s//${ORION_HOME:S/\//\\\//g}/" \ | ${SED} "/%%RC_SCRIPT_NAME%%/s//${PORTNAME}.sh/" \ | ${SED} "/%%JAVA_HOME%%/s//${JAVA_HOME:S/\//\\\//g}/" \ > ${ORIONCTL_DEST} - @${CHMOD} 755 ${ORIONCTL_DEST} - @${LN} -sf ${ORIONCTL_DEST} ${RC_SCRIPT} - @${MKDIR} ${ORION_HOME}/application-deployments - @${LN} -sf ${JAVA_HOME}/jre/tools.jar ${ORION_HOME}/tools.jar + ${CAT} ${FILESDIR}/${ORIONCTL_NAME}.1 \ + | ${SED} "/%%PREFIX%%/s//${PREFIX:S/\//\\\//g}/" \ + > ${WRKDIR}/${ORIONCTL_NAME}.1 + ${CHMOD} 755 ${ORIONCTL_DEST} + ${LN} -sf ${ORIONCTL_DEST} ${RC_SCRIPT} + ${MKDIR} ${ORION_HOME}/application-deployments + ${LN} -sf ${JAVA_HOME}/lib/tools.jar ${ORION_HOME}/tools.jar + ${INSTALL_MAN} ${WRKDIR}/orionctl.1 ${MANPREFIX}/man/man1 post-install: - @echo "${PORTTITLE} ${PORTVERSION} has been installed in ${ORION_HOME}." + @${ECHO} "${PORTTITLE} ${PORTVERSION} has been installed in ${ORION_HOME}." + @${ECHO} "Use 'man orionctl' for information about starting and stopping Orion." .include <bsd.port.post.mk> diff --git a/java/orion/files/orionctl b/java/orion/files/orionctl index cd4b252d1491..a238e9394301 100644 --- a/java/orion/files/orionctl +++ b/java/orion/files/orionctl @@ -30,9 +30,8 @@ case "$1" in if [ "${AS_RC_SCRIPT}" = "yes" ]; then echo "" fi - echo "${NAME}: ERROR: Orion has already been started." echo "${NAME}: ERROR: Found Orion PID file at ${PID_FILE}. Orion is probably already running." - exit 64 + exit 1 fi # Make sure the Orion directory does exist @@ -41,7 +40,7 @@ case "$1" in echo "" fi echo "${NAME}: ERROR: Unable to find Orion home directory at ${ORION_HOME}." - exit 64 + exit 2 fi # Make sure the Orion JAR file exists @@ -50,7 +49,7 @@ case "$1" in echo "" fi echo "${NAME}: ERROR: Unable to find Orion JAR file at ${JAR_FILE}." - exit 64 + exit 3 fi # Make sure the Java VM can be found @@ -59,7 +58,7 @@ case "$1" in echo "" fi echo "${NAME}: ERROR: Unable to find Java VM at ${JAVA_HOME}." - exit 64 + exit 4 fi # Create the process ID file @@ -83,14 +82,14 @@ case "$1" in # ...otherwise complain else echo "${NAME}: ERROR: Unable to find Orion PID file at ${PID_FILE}. Orion is probably not running." - exit 64 + exit 16 fi else if [ "${AS_RC_SCRIPT}" = "yes" ]; then echo -n " ${NAME}" fi /bin/kill `cat ${PID_FILE}` - rm ${PID_FILE} + rm -f ${PID_FILE} fi ;; diff --git a/java/orion/files/orionctl.1 b/java/orion/files/orionctl.1 new file mode 100644 index 000000000000..ed82a8ea30ff --- /dev/null +++ b/java/orion/files/orionctl.1 @@ -0,0 +1,96 @@ +.Dd May 26, 2001 +.Dt ORIONCTL 1 +.Os FreeBSD +.Sh NAME +.Nm orionctl +.Nd Orion server control interface +.Sh SYNOPSIS +.Nm +.Op Ar start | Ar stop +.Sh DESCRIPTION +The +.Nm +shell script provides an interface to the Orion application server. +.Pp +This script has 2 modes of operation, One is +.Em shell script mode +and the other is +.Em rc script mode . +If run as +.Nm +shell script mode is used, otherwise rc script mode is used. Shell script mode +assumes that the script is used as a normal shell script, while rc script mode +assumes the script is used to start or stop Orion at boot time. +.Pp +The script expects exactly one argument, either +.Ar start +or +.Ar stop . +If more than one argument is given, then all arguments but the first are +ignored. +.Bl -tag -width indent +.It Ar start +Start Orion, if it is not already running. The ID of the started process will +be saved in a PID file. +.It Ar stop +Stop Orion, if it is actually running. The process with the ID stored in +the PID file will be killed. +.El +.Sh ERRORS +The following error conditions are detected. They will be checked in the +specified order. In every case where an error message is printed it will be +prepended by the name of the script +.Em ( basename $0 ) . +.Pp +If no argument is passed, or if an argument other than +.Ar start +or +.Ar stop +is passed as the first argument, then a simple help message is printed and the +script is exited with error code 64. +.Pp +In +.Em rc script mode +a newline will be printed before any error message. +.Pp +When using the argument +.Ar start +the following errors conditions can be triggered: +.Bl -tag -width indent +.It Em The Orion PID file already exists. +Orion is probably already running. Prints an error message and exits the +script with error code 1. +.It Em Orion home directory cannot be found +Prints an error message and exits the script with error code 2. +.It Em Orion JAR file cannot be found +Prints an error message and exits the script with error code 3. +.It Em Java VM cannot be found +Prints an error message and exits the script with error code 4. +.El +.Pp +When using the argument +.Ar stop +the following error condition can be triggered: +.Bl -tag -width indent +.It Em The Orion PID file cannot be found +Orion is probably not running. Prints an error message and exits the script +with error code 16. +.El +.Sh FILES +.Bl -tag -width -indent +.It Pa /var/run/orion.pid +The Orion PID file that is used to store the process ID of the currently +running Orion process in. It is deleted as soon as Orion is stopped and +recreated when Orion is started. It should never be writable for anyone but +.Em root , +.It Pa %%PREFIX%%/etc/rc.d/orion.sh +A symlink to the +.Nm +script. This causes Orion to be started at boot time. When called from this +location the +.Nm +script will use +.Em rc script mode . +.El +.Sh AUTHORS +.An Ernst de Haan Aq ernst@jollem.com diff --git a/java/orion/pkg-deinstall b/java/orion/pkg-deinstall new file mode 100644 index 000000000000..3ebd95313283 --- /dev/null +++ b/java/orion/pkg-deinstall @@ -0,0 +1,8 @@ +#!/bin/sh +PID_FILE=/var/run/orion.pid +if [ -e ${PID_FILE} ]; then + echo -n "Orion is still running." + /bin/kill `cat ${PID_FILE}` + rm -f ${PID_FILE} + echo " Stopped." +fi diff --git a/java/orion/pkg-descr b/java/orion/pkg-descr index e7149bb25c8e..2e3f87b70b82 100644 --- a/java/orion/pkg-descr +++ b/java/orion/pkg-descr @@ -7,4 +7,10 @@ This version is only for development use or for non-commercial use. You need to purchase a license from http://www.orionserver.com/ if you would like to use this server commercially. +This port will install an 'orionctl' script in ${PREFIX}/bin that can be used +to start and stop the server. A man page for this script is installed. + +A script in ${PREFIX}/etc/rc.d/orion.sh typically causes Orion to be started +at boot time. This script is in fact a symlink to the orionctl script. + WWW: http://www.orionserver.com/ |