You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jeremy Whitlock <jw...@starprecision.com> on 2003/03/03 19:10:42 UTC

Tomcat as Linux Service

Tomcat List,
                Does anyone know how to get Tomcat to be a service on a
Linux Box?  Thanks,
 
Jeremy Whitlock --- MCP/MCSA
IT Manager for Star Precision, Inc.
Phone:  (970) 535-4795
Metro:  (303) 926-0559
Fax:  (970) 535-0780
Metro Fax:  (303) 926-0559
http://www.starprecision.com 
 

RE: Tomcat as Linux Service

Posted by Mike Jackson <mj...@cdi-hq.com>.
Or did you want it to start automatically on startup?  That'd be something
like this:

#!/bin/sh
case "$1" in
	start)
		nohup $TOMCAT_HOME/bin/startup.sh
		;;
	stop)
		$TOMCAT_HOME/bin/shutdown.sh
		;;
esac

put it into a file, chmod 0755 the file, and then put symbolic links in the
run levels you want it to run at.  If you want it to be started then make
the link S99file, to stop it's K00file.

--mikej
-=-----
mike jackson
mjackson@cdi-hq.com

> -----Original Message-----
> From: Jeremy Whitlock [mailto:jwhitlock@starprecision.com]
> Sent: Monday, March 03, 2003 10:11 AM
> To: Tomcat
> Subject: Tomcat as Linux Service
>
>
> Tomcat List,
>                 Does anyone know how to get Tomcat to be a service on a
> Linux Box?  Thanks,
>
> Jeremy Whitlock --- MCP/MCSA
> IT Manager for Star Precision, Inc.
> Phone:  (970) 535-4795
> Metro:  (303) 926-0559
> Fax:  (970) 535-0780
> Metro Fax:  (303) 926-0559
> http://www.starprecision.com
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Tomcat as Linux Service

Posted by Gerald Henriksen <gh...@rogers.com>.
On Mon, 3 Mar 2003 12:35:14 -0700, you wrote:

>	What are the names of them?  Thanks, Jeremy

rpms can be found with each release:

http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.18/rpms/

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Tomcat as Linux Service

Posted by Jeremy Whitlock <jw...@starprecision.com>.
DG,
	What are the names of them?  Thanks, Jeremy

-----Original Message-----
From: Daniel Graham [mailto:danny@sound.ee.umist.ac.uk] 
Sent: Monday, March 03, 2003 11:48 AM
To: Tomcat Users List
Subject: Re: Tomcat as Linux Service

The RPM's of tomcat4 that I've found recently (RedHat/Mandrake) all
have pre-built startup and stop scripts). 

You could locate one of those.

DG
----- Original Message ----- 
From: "Jeremy Whitlock" <jw...@starprecision.com>
To: "'Tomcat Users List'" <to...@jakarta.apache.org>
Sent: Monday, March 03, 2003 6:40 PM
Subject: RE: Tomcat as Linux Service


> Yes.  Right now I use the earlier posted script to start/stop/reload
> apache via "/sbin/service httpd start" and I'd like to do the same
with
> tomcat.  Here's how it would work:
> 
> Case 1) "Start" - It would check to see if Tomcat is already running.
> If it's not running, start it.  If it's running already, echo a
message.
> 
> Case2) "Stop" - It would check to see if Tomcat is running.  If it's
> running, stop it.  If it's not, echo a message.
> 
> Case 3) "Restart/Reload" - It would check to see if Tomcat is running.
> If it is, stop the service then start it.  If it's not running, echo a
> message.
> 
> How can I do this?  I see items in the Apache start script that would
do
> this but I don't know what some of the others are.  Can someone help
me
> achieve this?  This file would be "/etc/init.d/tomcat" after it's
> completed.  I would then chkconfig --add tomcat and boom, I have a
> service.  Any help would be greatly appreciated.  Thanks, Jeremy
> 
> 
> -----Original Message-----
> From: p2 - apache [mailto:apachep2@hotmail.com] 
> Sent: Monday, March 03, 2003 11:35 AM
> To: 'Tomcat Users List'
> Subject: RE: Tomcat as Linux Service
> 
> You mean create a service to start/shutdown a daemon?
> 
> -----Original Message-----
> From: Jeremy Whitlock [mailto:jwhitlock@starprecision.com] 
> Sent: March 3, 2003 1:11 PM
> To: Tomcat
> Subject: Tomcat as Linux Service
> 
> Tomcat List,
>                 Does anyone know how to get Tomcat to be a service on
a
> Linux Box?  Thanks,
>  
> Jeremy Whitlock --- MCP/MCSA
> IT Manager for Star Precision, Inc.
> Phone:  (970) 535-4795
> Metro:  (303) 926-0559
> Fax:  (970) 535-0780
> Metro Fax:  (303) 926-0559
> http://www.starprecision.com 
>  
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Tomcat as Linux Service

Posted by Daniel Graham <da...@sound.ee.umist.ac.uk>.
The RPM's of tomcat4 that I've found recently (RedHat/Mandrake) all
have pre-built startup and stop scripts). 

You could locate one of those.

DG
----- Original Message ----- 
From: "Jeremy Whitlock" <jw...@starprecision.com>
To: "'Tomcat Users List'" <to...@jakarta.apache.org>
Sent: Monday, March 03, 2003 6:40 PM
Subject: RE: Tomcat as Linux Service


> Yes.  Right now I use the earlier posted script to start/stop/reload
> apache via "/sbin/service httpd start" and I'd like to do the same with
> tomcat.  Here's how it would work:
> 
> Case 1) "Start" - It would check to see if Tomcat is already running.
> If it's not running, start it.  If it's running already, echo a message.
> 
> Case2) "Stop" - It would check to see if Tomcat is running.  If it's
> running, stop it.  If it's not, echo a message.
> 
> Case 3) "Restart/Reload" - It would check to see if Tomcat is running.
> If it is, stop the service then start it.  If it's not running, echo a
> message.
> 
> How can I do this?  I see items in the Apache start script that would do
> this but I don't know what some of the others are.  Can someone help me
> achieve this?  This file would be "/etc/init.d/tomcat" after it's
> completed.  I would then chkconfig --add tomcat and boom, I have a
> service.  Any help would be greatly appreciated.  Thanks, Jeremy
> 
> 
> -----Original Message-----
> From: p2 - apache [mailto:apachep2@hotmail.com] 
> Sent: Monday, March 03, 2003 11:35 AM
> To: 'Tomcat Users List'
> Subject: RE: Tomcat as Linux Service
> 
> You mean create a service to start/shutdown a daemon?
> 
> -----Original Message-----
> From: Jeremy Whitlock [mailto:jwhitlock@starprecision.com] 
> Sent: March 3, 2003 1:11 PM
> To: Tomcat
> Subject: Tomcat as Linux Service
> 
> Tomcat List,
>                 Does anyone know how to get Tomcat to be a service on a
> Linux Box?  Thanks,
>  
> Jeremy Whitlock --- MCP/MCSA
> IT Manager for Star Precision, Inc.
> Phone:  (970) 535-4795
> Metro:  (303) 926-0559
> Fax:  (970) 535-0780
> Metro Fax:  (303) 926-0559
> http://www.starprecision.com 
>  
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Tomcat as Linux Service

Posted by p2 - apache <ap...@hotmail.com>.
If you launch apachectl restart, I guess it checks if there is a PID
file. If httpd finds PID, it kills current process and starts a new
apache process.

However, there is no "restart" option for Tomcat. So you have to call
shutdown and then startup.


-----Original Message-----
From: Jeremy Whitlock [mailto:jwhitlock@starprecision.com] 
Sent: March 3, 2003 1:40 PM
To: 'Tomcat Users List'
Subject: RE: Tomcat as Linux Service

Yes.  Right now I use the earlier posted script to start/stop/reload
apache via "/sbin/service httpd start" and I'd like to do the same with
tomcat.  Here's how it would work:

Case 1) "Start" - It would check to see if Tomcat is already running.
If it's not running, start it.  If it's running already, echo a message.

Case2) "Stop" - It would check to see if Tomcat is running.  If it's
running, stop it.  If it's not, echo a message.

Case 3) "Restart/Reload" - It would check to see if Tomcat is running.
If it is, stop the service then start it.  If it's not running, echo a
message.

How can I do this?  I see items in the Apache start script that would do
this but I don't know what some of the others are.  Can someone help me
achieve this?  This file would be "/etc/init.d/tomcat" after it's
completed.  I would then chkconfig --add tomcat and boom, I have a
service.  Any help would be greatly appreciated.  Thanks, Jeremy


-----Original Message-----
From: p2 - apache [mailto:apachep2@hotmail.com] 
Sent: Monday, March 03, 2003 11:35 AM
To: 'Tomcat Users List'
Subject: RE: Tomcat as Linux Service

You mean create a service to start/shutdown a daemon?

-----Original Message-----
From: Jeremy Whitlock [mailto:jwhitlock@starprecision.com] 
Sent: March 3, 2003 1:11 PM
To: Tomcat
Subject: Tomcat as Linux Service

Tomcat List,
                Does anyone know how to get Tomcat to be a service on a
Linux Box?  Thanks,
 
Jeremy Whitlock --- MCP/MCSA
IT Manager for Star Precision, Inc.
Phone:  (970) 535-4795
Metro:  (303) 926-0559
Fax:  (970) 535-0780
Metro Fax:  (303) 926-0559
http://www.starprecision.com 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Tomcat as Linux Service

Posted by Jeremy Whitlock <jw...@starprecision.com>.
Yes.  Right now I use the earlier posted script to start/stop/reload
apache via "/sbin/service httpd start" and I'd like to do the same with
tomcat.  Here's how it would work:

Case 1) "Start" - It would check to see if Tomcat is already running.
If it's not running, start it.  If it's running already, echo a message.

Case2) "Stop" - It would check to see if Tomcat is running.  If it's
running, stop it.  If it's not, echo a message.

Case 3) "Restart/Reload" - It would check to see if Tomcat is running.
If it is, stop the service then start it.  If it's not running, echo a
message.

How can I do this?  I see items in the Apache start script that would do
this but I don't know what some of the others are.  Can someone help me
achieve this?  This file would be "/etc/init.d/tomcat" after it's
completed.  I would then chkconfig --add tomcat and boom, I have a
service.  Any help would be greatly appreciated.  Thanks, Jeremy


-----Original Message-----
From: p2 - apache [mailto:apachep2@hotmail.com] 
Sent: Monday, March 03, 2003 11:35 AM
To: 'Tomcat Users List'
Subject: RE: Tomcat as Linux Service

You mean create a service to start/shutdown a daemon?

-----Original Message-----
From: Jeremy Whitlock [mailto:jwhitlock@starprecision.com] 
Sent: March 3, 2003 1:11 PM
To: Tomcat
Subject: Tomcat as Linux Service

Tomcat List,
                Does anyone know how to get Tomcat to be a service on a
Linux Box?  Thanks,
 
Jeremy Whitlock --- MCP/MCSA
IT Manager for Star Precision, Inc.
Phone:  (970) 535-4795
Metro:  (303) 926-0559
Fax:  (970) 535-0780
Metro Fax:  (303) 926-0559
http://www.starprecision.com 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Tomcat as Linux Service

Posted by p2 - apache <ap...@hotmail.com>.
You mean create a service to start/shutdown a daemon?

-----Original Message-----
From: Jeremy Whitlock [mailto:jwhitlock@starprecision.com] 
Sent: March 3, 2003 1:11 PM
To: Tomcat
Subject: Tomcat as Linux Service

Tomcat List,
                Does anyone know how to get Tomcat to be a service on a
Linux Box?  Thanks,
 
Jeremy Whitlock --- MCP/MCSA
IT Manager for Star Precision, Inc.
Phone:  (970) 535-4795
Metro:  (303) 926-0559
Fax:  (970) 535-0780
Metro Fax:  (303) 926-0559
http://www.starprecision.com 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Tomcat as Linux Service

Posted by "Kenny G. Dubuisson, Jr." <kd...@kcmria.com>.
Included in this doc http://myweb.cableone.net/kdubuisson/Install.PDF I have
instructions for setting up Tomcat to autostart on Linux.  Hope this helps,
Kenny

----- Original Message -----
From: "p2 - apache" <ap...@hotmail.com>
To: "'Tomcat Users List'" <to...@jakarta.apache.org>
Sent: Monday, March 03, 2003 12:39 PM
Subject: RE: Tomcat as Linux Service


> Do the same thing to tomcat, replace httpd with startup.sh and
> shutdown.sh?
>
> Regards,
>
>
> PQ
>
> "This Guy Thinks He Knows Everything"
> "This Guy Thinks He Knows What He Is Doing"
>
> -----Original Message-----
> From: Jeremy Whitlock [mailto:jwhitlock@starprecision.com]
> Sent: March 3, 2003 1:17 PM
> To: 'Tomcat Users List'
> Subject: RE: Tomcat as Linux Service
>
> Mike,
> What I'm looking for is similar to the way you can start Apache.
> In the Service Tool in Red Hat, it lists all available services where
> you can start/stop/restart from there or you can "/sbin/service
> servicename start".  Here is the script for Apache:
>
> #!/bin/bash
> #
> # Startup script for the Apache Web Server
> #
> # chkconfig: - 85 15
> # description: Apache is a World Wide Web server. It is used to serve \
> # HTML files and CGI.
> # processname: httpd
> # pidfile: /var/run/httpd.pid
> # config: /usr/local/apache2/conf/httpd.conf
>
> # Source function library.
> . /etc/rc.d/init.d/functions
>
> if [ -f /etc/sysconfig/httpd ]; then
> . /etc/sysconfig/httpd
> fi
>
> # This will prevent initlog from swallowing up a pass-phrase prompt if
> # mod_ssl needs a pass-phrase from the user.
> INITLOG_ARGS=""
>
> # Path to the apachectl script, server binary, and short-form for
> messages.
> apachectl=/usr/local/apache2/bin/apachectl
> httpd=/usr/local/apache2/bin/httpd
> prog=httpd
> RETVAL=0
>
> # check for 1.3 configuration
> check13 () {
> CONFFILE=/usr/local/apache2/conf/httpd.conf
> GONE="(ServerType|BindAddress|Port|AddModule|ClearModuleList|"
> GONE="${GONE}AgentLog|RefererLog|RefererIgnore|FancyIndexing|"
> GONE="${GONE}AccessConfig|ResourceConfig)"
> if grep -Eiq "^[[:space:]]*($GONE)" $CONFFILE; then
> echo
> echo 1>&2 " Apache 1.3 configuration directives found"
> echo 1>&2 " please read
> /usr/local/apache2/doc/httpd-2.0.40/migration.html"
> failure "Apache 1.3 config directives test"
> echo
> exit 1
> fi
> }
>
> # The semantics of these two functions differ from the way apachectl
> does
> # things -- attempting to start while running is a failure, and shutdown
> # when not running is also a failure. So we just do it the way init
> scripts
> # are expected to behave here.
> start() {
> echo -n $"Starting $prog: "
> check13 || exit 1
> daemon $httpd $OPTIONS
> RETVAL=$?
> echo
> [ $RETVAL = 0 ] && touch /var/lock/subsys/httpd
> return $RETVAL
> }
> stop() {
> echo -n $"Stopping $prog: "
> killproc $httpd
> RETVAL=$?
> echo
> [ $RETVAL = 0 ] && rm -f /var/lock/subsys/httpd /var/run/httpd.pid
> }
> reload() {
> echo -n $"Reloading $prog: "
> check13 || exit 1
> killproc $httpd -HUP
> RETVAL=$?
> echo
> }
>
> # See how we were called.
> case "$1" in
> start)
> start
> ;;
> stop)
> stop
> ;;
> status)
> status $httpd
> RETVAL=$?
> ;;
> restart)
> stop
> start
> ;;
> condrestart)
> if [ -f /var/run/httpd.pid ] ; then
> stop
> start
> fi
> ;;
> reload)
> reload
> ;;
> graceful|help|configtest|fullstatus)
> $apachectl $@
> RETVAL=$?
> ;;
> *)
> echo $"Usage: $prog
> {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|c
> onfigtest}"
> exit 1
> esac
>
> exit $RETVAL
>
> Make sense what I want to do?  Thanks, Jeremy
>
> -----Original Message-----
> From: Mike Jackson [mailto:mjackson@cdi-hq.com]
> Sent: Monday, March 03, 2003 11:18 AM
> To: Tomcat Users List
> Subject: RE: Tomcat as Linux Service
>
> nohup $TOMCAT_HOME/bin/startup.sh &
>
> --mikej
> -=-----
> mike jackson
> mjackson@cdi-hq.com
>
> > -----Original Message-----
> > From: Jeremy Whitlock [mailto:jwhitlock@starprecision.com]
> > Sent: Monday, March 03, 2003 10:11 AM
> > To: Tomcat
> > Subject: Tomcat as Linux Service
> >
> >
> > Tomcat List,
> >                 Does anyone know how to get Tomcat to be a service on
> a
> > Linux Box?  Thanks,
> >
> > Jeremy Whitlock --- MCP/MCSA
> > IT Manager for Star Precision, Inc.
> > Phone:  (970) 535-4795
> > Metro:  (303) 926-0559
> > Fax:  (970) 535-0780
> > Metro Fax:  (303) 926-0559
> > http://www.starprecision.com
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Tomcat as Linux Service

Posted by p2 - apache <ap...@hotmail.com>.
Do the same thing to tomcat, replace httpd with startup.sh and
shutdown.sh?

Regards,
 
 
PQ
 
"This Guy Thinks He Knows Everything"
"This Guy Thinks He Knows What He Is Doing"

-----Original Message-----
From: Jeremy Whitlock [mailto:jwhitlock@starprecision.com] 
Sent: March 3, 2003 1:17 PM
To: 'Tomcat Users List'
Subject: RE: Tomcat as Linux Service

Mike,
	What I'm looking for is similar to the way you can start Apache.
In the Service Tool in Red Hat, it lists all available services where
you can start/stop/restart from there or you can "/sbin/service
servicename start".  Here is the script for Apache:

#!/bin/bash
#
# Startup script for the Apache Web Server
#
# chkconfig: - 85 15
# description: Apache is a World Wide Web server. It is used to serve \
# HTML files and CGI.
# processname: httpd
# pidfile: /var/run/httpd.pid
# config: /usr/local/apache2/conf/httpd.conf

# Source function library.
. /etc/rc.d/init.d/functions

if [ -f /etc/sysconfig/httpd ]; then
. /etc/sysconfig/httpd
fi

# This will prevent initlog from swallowing up a pass-phrase prompt if
# mod_ssl needs a pass-phrase from the user.
INITLOG_ARGS=""

# Path to the apachectl script, server binary, and short-form for
messages.
apachectl=/usr/local/apache2/bin/apachectl
httpd=/usr/local/apache2/bin/httpd
prog=httpd
RETVAL=0

# check for 1.3 configuration
check13 () {
CONFFILE=/usr/local/apache2/conf/httpd.conf
GONE="(ServerType|BindAddress|Port|AddModule|ClearModuleList|"
GONE="${GONE}AgentLog|RefererLog|RefererIgnore|FancyIndexing|"
GONE="${GONE}AccessConfig|ResourceConfig)"
if grep -Eiq "^[[:space:]]*($GONE)" $CONFFILE; then
echo
echo 1>&2 " Apache 1.3 configuration directives found"
echo 1>&2 " please read
/usr/local/apache2/doc/httpd-2.0.40/migration.html"
failure "Apache 1.3 config directives test"
echo
exit 1
fi
}

# The semantics of these two functions differ from the way apachectl
does
# things -- attempting to start while running is a failure, and shutdown
# when not running is also a failure. So we just do it the way init
scripts
# are expected to behave here.
start() {
echo -n $"Starting $prog: "
check13 || exit 1
daemon $httpd $OPTIONS
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/httpd
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $httpd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/httpd /var/run/httpd.pid
}
reload() {
echo -n $"Reloading $prog: "
check13 || exit 1
killproc $httpd -HUP
RETVAL=$?
echo
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $httpd
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
if [ -f /var/run/httpd.pid ] ; then
stop
start
fi
;;
reload)
reload
;;
graceful|help|configtest|fullstatus)
$apachectl $@
RETVAL=$?
;;
*)
echo $"Usage: $prog
{start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|c
onfigtest}"
exit 1
esac

exit $RETVAL

Make sense what I want to do?  Thanks, Jeremy

-----Original Message-----
From: Mike Jackson [mailto:mjackson@cdi-hq.com] 
Sent: Monday, March 03, 2003 11:18 AM
To: Tomcat Users List
Subject: RE: Tomcat as Linux Service

nohup $TOMCAT_HOME/bin/startup.sh &

--mikej
-=-----
mike jackson
mjackson@cdi-hq.com 

> -----Original Message-----
> From: Jeremy Whitlock [mailto:jwhitlock@starprecision.com]
> Sent: Monday, March 03, 2003 10:11 AM
> To: Tomcat
> Subject: Tomcat as Linux Service
> 
> 
> Tomcat List,
>                 Does anyone know how to get Tomcat to be a service on
a
> Linux Box?  Thanks,
>  
> Jeremy Whitlock --- MCP/MCSA
> IT Manager for Star Precision, Inc.
> Phone:  (970) 535-4795
> Metro:  (303) 926-0559
> Fax:  (970) 535-0780
> Metro Fax:  (303) 926-0559
> http://www.starprecision.com 
>  
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Tomcat as Linux Service

Posted by Jeremy Whitlock <jw...@starprecision.com>.
Mike,
	What I'm looking for is similar to the way you can start Apache.
In the Service Tool in Red Hat, it lists all available services where
you can start/stop/restart from there or you can "/sbin/service
servicename start".  Here is the script for Apache:

#!/bin/bash
#
# Startup script for the Apache Web Server
#
# chkconfig: - 85 15
# description: Apache is a World Wide Web server. It is used to serve \
# HTML files and CGI.
# processname: httpd
# pidfile: /var/run/httpd.pid
# config: /usr/local/apache2/conf/httpd.conf

# Source function library.
. /etc/rc.d/init.d/functions

if [ -f /etc/sysconfig/httpd ]; then
. /etc/sysconfig/httpd
fi

# This will prevent initlog from swallowing up a pass-phrase prompt if
# mod_ssl needs a pass-phrase from the user.
INITLOG_ARGS=""

# Path to the apachectl script, server binary, and short-form for
messages.
apachectl=/usr/local/apache2/bin/apachectl
httpd=/usr/local/apache2/bin/httpd
prog=httpd
RETVAL=0

# check for 1.3 configuration
check13 () {
CONFFILE=/usr/local/apache2/conf/httpd.conf
GONE="(ServerType|BindAddress|Port|AddModule|ClearModuleList|"
GONE="${GONE}AgentLog|RefererLog|RefererIgnore|FancyIndexing|"
GONE="${GONE}AccessConfig|ResourceConfig)"
if grep -Eiq "^[[:space:]]*($GONE)" $CONFFILE; then
echo
echo 1>&2 " Apache 1.3 configuration directives found"
echo 1>&2 " please read
/usr/local/apache2/doc/httpd-2.0.40/migration.html"
failure "Apache 1.3 config directives test"
echo
exit 1
fi
}

# The semantics of these two functions differ from the way apachectl
does
# things -- attempting to start while running is a failure, and shutdown
# when not running is also a failure. So we just do it the way init
scripts
# are expected to behave here.
start() {
echo -n $"Starting $prog: "
check13 || exit 1
daemon $httpd $OPTIONS
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/httpd
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $httpd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/httpd /var/run/httpd.pid
}
reload() {
echo -n $"Reloading $prog: "
check13 || exit 1
killproc $httpd -HUP
RETVAL=$?
echo
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $httpd
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
if [ -f /var/run/httpd.pid ] ; then
stop
start
fi
;;
reload)
reload
;;
graceful|help|configtest|fullstatus)
$apachectl $@
RETVAL=$?
;;
*)
echo $"Usage: $prog
{start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|c
onfigtest}"
exit 1
esac

exit $RETVAL

Make sense what I want to do?  Thanks, Jeremy

-----Original Message-----
From: Mike Jackson [mailto:mjackson@cdi-hq.com] 
Sent: Monday, March 03, 2003 11:18 AM
To: Tomcat Users List
Subject: RE: Tomcat as Linux Service

nohup $TOMCAT_HOME/bin/startup.sh &

--mikej
-=-----
mike jackson
mjackson@cdi-hq.com 

> -----Original Message-----
> From: Jeremy Whitlock [mailto:jwhitlock@starprecision.com]
> Sent: Monday, March 03, 2003 10:11 AM
> To: Tomcat
> Subject: Tomcat as Linux Service
> 
> 
> Tomcat List,
>                 Does anyone know how to get Tomcat to be a service on
a
> Linux Box?  Thanks,
>  
> Jeremy Whitlock --- MCP/MCSA
> IT Manager for Star Precision, Inc.
> Phone:  (970) 535-4795
> Metro:  (303) 926-0559
> Fax:  (970) 535-0780
> Metro Fax:  (303) 926-0559
> http://www.starprecision.com 
>  
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Tomcat as Linux Service

Posted by Mike Jackson <mj...@cdi-hq.com>.
nohup $TOMCAT_HOME/bin/startup.sh &

--mikej
-=-----
mike jackson
mjackson@cdi-hq.com 

> -----Original Message-----
> From: Jeremy Whitlock [mailto:jwhitlock@starprecision.com]
> Sent: Monday, March 03, 2003 10:11 AM
> To: Tomcat
> Subject: Tomcat as Linux Service
> 
> 
> Tomcat List,
>                 Does anyone know how to get Tomcat to be a service on a
> Linux Box?  Thanks,
>  
> Jeremy Whitlock --- MCP/MCSA
> IT Manager for Star Precision, Inc.
> Phone:  (970) 535-4795
> Metro:  (303) 926-0559
> Fax:  (970) 535-0780
> Metro Fax:  (303) 926-0559
> http://www.starprecision.com 
>  
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org