aboutsummaryrefslogtreecommitdiff
path: root/www/tomcat7/files/tomcat6.sh.in
diff options
context:
space:
mode:
authorAlex Dupre <ale@FreeBSD.org>2010-07-26 11:13:32 +0000
committerAlex Dupre <ale@FreeBSD.org>2010-07-26 11:13:32 +0000
commit4002dc80c73e7e51cbb7321b3fff3504152de272 (patch)
tree567b8bac6d5fe2580ef81be411bf7a7f51f62c07 /www/tomcat7/files/tomcat6.sh.in
parentec3a438a22fbb97983629d2ef436acbb7917d689 (diff)
downloadports-4002dc80c73e7e51cbb7321b3fff3504152de272.tar.gz
ports-4002dc80c73e7e51cbb7321b3fff3504152de272.zip
Notes
Diffstat (limited to 'www/tomcat7/files/tomcat6.sh.in')
-rw-r--r--www/tomcat7/files/tomcat6.sh.in30
1 files changed, 23 insertions, 7 deletions
diff --git a/www/tomcat7/files/tomcat6.sh.in b/www/tomcat7/files/tomcat6.sh.in
index ef05ec5a4656..42bf6c29fc62 100644
--- a/www/tomcat7/files/tomcat6.sh.in
+++ b/www/tomcat7/files/tomcat6.sh.in
@@ -113,6 +113,8 @@ flags="-p ${pidfile} ${java_command} start ${tomcat%%TOMCAT_VERSION%%_flags} ${l
start_precmd="pid_touch"
stop_cmd="tomcat_stop"
+status_cmd="tomcat_status"
+poll_cmd="tomcat_poll"
pid_touch() {
touch $pidfile
@@ -124,11 +126,7 @@ tomcat_stop() {
if [ -z "$rc_pid" ]; then
[ -n "$rc_fast" ] && return 0
- if [ -n "$pidfile" ]; then
- echo "${name} not running? (check $pidfile)."
- else
- echo "${name} not running?"
- fi
+ echo "${name} not running? (check $pidfile)."
return 1
fi
@@ -139,10 +137,28 @@ tomcat_stop() {
rm -f ${pidfile}
}
+tomcat_status() {
+ rc_pid=$(tomcat_check_pidfile $pidfile)
+
+ if [ -z "$rc_pid" ]; then
+ [ -n "$rc_fast" ] && return 0
+ echo "${name} not running? (check $pidfile)."
+ return 1
+ fi
+}
+
+tomcat_poll() {
+ while (true) ; do
+ rc_pid=$(tomcat_check_pidfile $pidfile)
+ [ -z "$rc_pid" ] && break
+ sleep 2
+ done
+}
+
tomcat_check_pidfile() {
_pidfile=$1
- if [ -z "$_pidfile" -o -z "$_procname" ]; then
- err 3 'USAGE: check_pidfile pidfile procname [interpreter]'
+ if [ -z "$_pidfile" ]; then
+ err 3 'USAGE: tomcat_check_pidfile pidfile'
fi
if [ ! -f $_pidfile ]; then
debug "pid file ($_pidfile): not readable."