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
This commit is contained in:
Maxim Sobolev 2001-06-12 10:20:48 +00:00
parent 043fe06cfd
commit 1aa47310ca
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=43888
15 changed files with 393 additions and 51 deletions

View file

@ -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>

View file

@ -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
;;

View file

@ -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

8
java/orion/pkg-deinstall Normal file
View file

@ -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

View file

@ -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/

View file

@ -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>

View file

@ -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
;;

View file

@ -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

View file

@ -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

View file

@ -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/

View file

@ -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>

View file

@ -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
;;

View file

@ -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

8
www/orion/pkg-deinstall Normal file
View file

@ -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

View file

@ -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/