aboutsummaryrefslogtreecommitdiffstats
path: root/www/orion-devel/files
diff options
context:
space:
mode:
authorznerd <znerd@FreeBSD.org>2002-03-08 03:47:15 +0800
committerznerd <znerd@FreeBSD.org>2002-03-08 03:47:15 +0800
commit3be4bb92609df4391779e585edc9969d750b673b (patch)
treef421cfd19cdfce2c8a766132324643af00a7327d /www/orion-devel/files
parent5affc28810ade8ad03b7a2b0e67b7591bd8bf1d5 (diff)
downloadfreebsd-ports-graphics-3be4bb92609df4391779e585edc9969d750b673b.tar.gz
freebsd-ports-graphics-3be4bb92609df4391779e585edc9969d750b673b.tar.zst
freebsd-ports-graphics-3be4bb92609df4391779e585edc9969d750b673b.zip
Not deleting the PID file but emptying it. Reasoning behind
this is that /var/run is not writable to 'www'. Also cleaned things up here and there. Bumped PORTREVISION.
Diffstat (limited to 'www/orion-devel/files')
-rw-r--r--www/orion-devel/files/orion.sh5
-rw-r--r--www/orion-devel/files/orionctl40
2 files changed, 32 insertions, 13 deletions
diff --git a/www/orion-devel/files/orion.sh b/www/orion-devel/files/orion.sh
index cbd3e16f99b..f76448b0b83 100644
--- a/www/orion-devel/files/orion.sh
+++ b/www/orion-devel/files/orion.sh
@@ -1,15 +1,14 @@
#!/bin/sh
# Set some variables
-USER_NAME=%%USER_NAME%%
MYSELF=`basename $0`
case "$1" in
start)
- su -f -m ${USER_NAME} -c "exec %%CONTROL_SCRIPT%% start" && echo -n ' %%APP_SHORTNAME%%'
+ su -f -m %%USER%% -c "exec %%CONTROL_SCRIPT%% start" && echo -n ' %%APP_SHORTNAME%%'
;;
stop)
- su -f -m ${USER_NAME} -c "exec %%CONTROL_SCRIPT%% stop" && echo -n ' %%APP_SHORTNAME%%'
+ su -f -m %%USER%% -c "exec %%CONTROL_SCRIPT%% stop" && echo -n ' %%APP_SHORTNAME%%'
;;
*)
echo ""
diff --git a/www/orion-devel/files/orionctl b/www/orion-devel/files/orionctl
index eb1114d1cc0..d6325382f82 100644
--- a/www/orion-devel/files/orionctl
+++ b/www/orion-devel/files/orionctl
@@ -91,20 +91,27 @@ app() {
start() {
# Make sure the application is not started previously
- if [ -e %%PID_FILE%% ]; then
- error "Found %%APP_TITLE%% PID file at %%PID_FILE%%. It is probably already running."
+ if [ -s %%PID_FILE%% ]; then
+ error "%%APP_TITLE%% is probably already running. The PID file at %%PID_FILE%% is not empty."
exit 1
fi
# Perform the checks that apply to stopping as well
checks
- # Create the process ID file
- rm -f %%PID_FILE%%
- touch %%PID_FILE%%
- chown %%USER_NAME%%:%%GROUP_NAME%% %%PID_FILE%%
+ # Fix the permissions for the PID file, just in case
+ chown %%USER%%:%%GROUP%% %%PID_FILE%%
chmod 600 %%PID_FILE%%
+
+ # Start the application
+ echo -n ">> Starting %%APP_TITLE%%..."
(cd ${APP_HOME} && ${JAVA_CMD} -jar ${JAR_FILE} & echo $! > %%PID_FILE%%) >> ${STDOUT_LOG} 2>> ${STDERR_LOG}
+ if [ $? -eq 0 ]; then
+ echo " [ DONE ]"
+ else
+ echo " [ FAILED ]"
+ exit 13
+ fi
}
@@ -120,12 +127,25 @@ stop() {
checks
# Kill the running program
- if [ ! -e %%PID_FILE%% ]; then
- error "Unable to find %%APP_TITLE%% PID file at %%PID_FILE%%. It is probably not running."
+ if [ ! -s %%PID_FILE%% ]; then
+ error "%%APP_TITLE%% is probably not running. The PID file at %%PID_FILE%% is empty."
exit 16
fi
- /bin/kill `cat %%PID_FILE%%`
- rm -f %%PID_FILE%%
+ PID=`cat %%PID_FILE%%`
+ echo -n ">> Killing %%APP_TITLE%% process (${PID})..."
+ /bin/kill ${PID} > /dev/null 2> /dev/null
+ if [ $? -eq 0 ]; then
+ echo " [ DONE ]"
+ else
+ echo " [ FAILED ]"
+ fi
+ echo -n ">> Emptying PID file (%%PID_FILE%%)..."
+ > %%PID_FILE%% 2> /dev/null
+ if [ $? -eq 0 ]; then
+ echo " [ DONE ]"
+ else
+ echo " [ FAILED ]"
+ fi
}