You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by si...@insession.com on 2005/07/04 14:22:59 UTC

Startup Scripts discussion ( GERONIMO-693 )

To get the ball rolling on startup scripts 
http://issues.apache.org/jira/browse/GERONIMO-693 , what do people think 
about basing the startup scripts (as much as possible) on tomcat's 
catalina.bat & catalina.sh 
http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/catalina/src/bin/ 
(since they have been used for years and many users would be familiar with 
their style of configuration)?

Here is my initial list of requirements for startup scripts for 
discussion.  If anyone else has some requirements to add (please indicate 
priority.. e.g. mandatory or nice to have)?  I will consolidate comments 
into a proposal (e.g. documenting command syntax).

Server Startup:
============
* script must specify -Djava.endorsed.dirs=lib/endorsed to ensure Tomcat 
works
* allow plan names to be specified for advanced users. 
* start under JPDA debugger if 1st argument is "jpda" instead of "start" 
(optional JPDA_TRANSPORT & JPDA_ADDRESS environment variables)
* start under security manager (causes -Djava.security.manager and 
-Djava.security.policy==xx to be passed to the JVM)  How should a policy 
file be specified?
* specify directory for temporary files (e.g. GERONIMO_TMPDIR environment 
variable)
* allow jvm options to be passed (e.g. JAVA_OPTS environment variable)
* (for discussion) should the one server startup script also be used for 
starting Geronimo as a service?  I don't plan to implement this initially, 
but would like to plan how we would do it.  Currently Tomcat can be 
started as a service, but they don't use a script to start it as a 
service.  See http://jakarta.apache.org/tomcat/tomcat-5.5-doc/setup.html . 
Does anyone know if there is a JIRA issue for starting Geronimo as a 
service?  I can't find one.

* (for discussion) Can we introduce some type of startup mode parameter 
that removes the need for people to remember to start the 
org/apache/geronimo/RuntimeDeployer configId).  Could having such a 
parameter make manuals/books easier to write?  I see a few possible modes 
of startup (please comment if you can think of others):
  - start with previous configuration (no configIds specified as arguments 
on Java command).  This would be the default mode.
  - start with a specific list of configIds.  Only these configIds will be 
started. 
  - start with a minimal configuration for J2EE (this includes the 
org/apache/geronimo/RuntimeDeployer configuration).
  - (future) start with a minimal configuration for non-J2EE use.  There 
was a discussion on the dev list
  - (future) start with a rolled back configuration?

Server Shutdown
==============
More thought needed here. Any comments?

Deploy Tool Startup:
=================
* starting under JPDA debugger
* allow jvm options to be passed

Currently the deploy tool accepts some parameters with two leading minus 
characters (e.g. --user system).  The Tomcat startup scripts currently 
have parameters that have a single leading minus character (e.g. 
-security).  Should the startup script parameters be using the same prefix 
(two leading minus characters) as the Java code or should it be using a 
different prefix?

John

This e-mail message and any attachments may contain confidential, 
proprietary or non-public information.  This information is intended 
solely for the designated recipient(s).  If an addressing or transmission 
error has misdirected this e-mail, please notify the sender immediately 
and destroy this e-mail.  Any review, dissemination, use or reliance upon 
this information by unintended recipients is prohibited.  Any opinions 
expressed in this e-mail are those of the author personally.

Re: Startup Scripts discussion ( GERONIMO-693 )

Posted by Jeff Genender <jg...@savoirtech.com>.
+1 on the switch idea.  It would be nice to have this sort of control.

Aaron Mulder wrote:
> 	I guess one of the important questions -- and maybe this is what
> you meant by a service -- is should Geronimo be launched in the background
> or left running for Ctrl-C.  The Tomcat builds I've used semi-recently
> seem to kick it off in the background.  I kind of prefer the foreground
> during development, and background for servers.  It would be extra nice
> just to support a -daemon switch or something (so the default was
> foreground but it's easy to force into the background).
> 
> Aaron
> 
> On Mon, 4 Jul 2005 sissonj@insession.com wrote:
> 
>>To get the ball rolling on startup scripts 
>>http://issues.apache.org/jira/browse/GERONIMO-693 , what do people think 
>>about basing the startup scripts (as much as possible) on tomcat's 
>>catalina.bat & catalina.sh 
>>http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/catalina/src/bin/ 
>>(since they have been used for years and many users would be familiar with 
>>their style of configuration)?
>>
>>Here is my initial list of requirements for startup scripts for 
>>discussion.  If anyone else has some requirements to add (please indicate 
>>priority.. e.g. mandatory or nice to have)?  I will consolidate comments 
>>into a proposal (e.g. documenting command syntax).
>>
>>Server Startup:
>>============
>>* script must specify -Djava.endorsed.dirs=lib/endorsed to ensure Tomcat 
>>works
>>* allow plan names to be specified for advanced users. 
>>* start under JPDA debugger if 1st argument is "jpda" instead of "start" 
>>(optional JPDA_TRANSPORT & JPDA_ADDRESS environment variables)
>>* start under security manager (causes -Djava.security.manager and 
>>-Djava.security.policy==xx to be passed to the JVM)  How should a policy 
>>file be specified?
>>* specify directory for temporary files (e.g. GERONIMO_TMPDIR environment 
>>variable)
>>* allow jvm options to be passed (e.g. JAVA_OPTS environment variable)
>>* (for discussion) should the one server startup script also be used for 
>>starting Geronimo as a service?  I don't plan to implement this initially, 
>>but would like to plan how we would do it.  Currently Tomcat can be 
>>started as a service, but they don't use a script to start it as a 
>>service.  See http://jakarta.apache.org/tomcat/tomcat-5.5-doc/setup.html . 
>>Does anyone know if there is a JIRA issue for starting Geronimo as a 
>>service?  I can't find one.
>>
>>* (for discussion) Can we introduce some type of startup mode parameter 
>>that removes the need for people to remember to start the 
>>org/apache/geronimo/RuntimeDeployer configId).  Could having such a 
>>parameter make manuals/books easier to write?  I see a few possible modes 
>>of startup (please comment if you can think of others):
>>  - start with previous configuration (no configIds specified as arguments 
>>on Java command).  This would be the default mode.
>>  - start with a specific list of configIds.  Only these configIds will be 
>>started. 
>>  - start with a minimal configuration for J2EE (this includes the 
>>org/apache/geronimo/RuntimeDeployer configuration).
>>  - (future) start with a minimal configuration for non-J2EE use.  There 
>>was a discussion on the dev list
>>  - (future) start with a rolled back configuration?
>>
>>Server Shutdown
>>==============
>>More thought needed here. Any comments?
>>
>>Deploy Tool Startup:
>>=================
>>* starting under JPDA debugger
>>* allow jvm options to be passed
>>
>>Currently the deploy tool accepts some parameters with two leading minus 
>>characters (e.g. --user system).  The Tomcat startup scripts currently 
>>have parameters that have a single leading minus character (e.g. 
>>-security).  Should the startup script parameters be using the same prefix 
>>(two leading minus characters) as the Java code or should it be using a 
>>different prefix?
>>
>>John
>>
>>This e-mail message and any attachments may contain confidential, 
>>proprietary or non-public information.  This information is intended 
>>solely for the designated recipient(s).  If an addressing or transmission 
>>error has misdirected this e-mail, please notify the sender immediately 
>>and destroy this e-mail.  Any review, dissemination, use or reliance upon 
>>this information by unintended recipients is prohibited.  Any opinions 
>>expressed in this e-mail are those of the author personally.

Re: Startup Scripts discussion ( GERONIMO-693 )

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
	I guess one of the important questions -- and maybe this is what
you meant by a service -- is should Geronimo be launched in the background
or left running for Ctrl-C.  The Tomcat builds I've used semi-recently
seem to kick it off in the background.  I kind of prefer the foreground
during development, and background for servers.  It would be extra nice
just to support a -daemon switch or something (so the default was
foreground but it's easy to force into the background).

Aaron

On Mon, 4 Jul 2005 sissonj@insession.com wrote:
> To get the ball rolling on startup scripts 
> http://issues.apache.org/jira/browse/GERONIMO-693 , what do people think 
> about basing the startup scripts (as much as possible) on tomcat's 
> catalina.bat & catalina.sh 
> http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/catalina/src/bin/ 
> (since they have been used for years and many users would be familiar with 
> their style of configuration)?
> 
> Here is my initial list of requirements for startup scripts for 
> discussion.  If anyone else has some requirements to add (please indicate 
> priority.. e.g. mandatory or nice to have)?  I will consolidate comments 
> into a proposal (e.g. documenting command syntax).
> 
> Server Startup:
> ============
> * script must specify -Djava.endorsed.dirs=lib/endorsed to ensure Tomcat 
> works
> * allow plan names to be specified for advanced users. 
> * start under JPDA debugger if 1st argument is "jpda" instead of "start" 
> (optional JPDA_TRANSPORT & JPDA_ADDRESS environment variables)
> * start under security manager (causes -Djava.security.manager and 
> -Djava.security.policy==xx to be passed to the JVM)  How should a policy 
> file be specified?
> * specify directory for temporary files (e.g. GERONIMO_TMPDIR environment 
> variable)
> * allow jvm options to be passed (e.g. JAVA_OPTS environment variable)
> * (for discussion) should the one server startup script also be used for 
> starting Geronimo as a service?  I don't plan to implement this initially, 
> but would like to plan how we would do it.  Currently Tomcat can be 
> started as a service, but they don't use a script to start it as a 
> service.  See http://jakarta.apache.org/tomcat/tomcat-5.5-doc/setup.html . 
> Does anyone know if there is a JIRA issue for starting Geronimo as a 
> service?  I can't find one.
> 
> * (for discussion) Can we introduce some type of startup mode parameter 
> that removes the need for people to remember to start the 
> org/apache/geronimo/RuntimeDeployer configId).  Could having such a 
> parameter make manuals/books easier to write?  I see a few possible modes 
> of startup (please comment if you can think of others):
>   - start with previous configuration (no configIds specified as arguments 
> on Java command).  This would be the default mode.
>   - start with a specific list of configIds.  Only these configIds will be 
> started. 
>   - start with a minimal configuration for J2EE (this includes the 
> org/apache/geronimo/RuntimeDeployer configuration).
>   - (future) start with a minimal configuration for non-J2EE use.  There 
> was a discussion on the dev list
>   - (future) start with a rolled back configuration?
> 
> Server Shutdown
> ==============
> More thought needed here. Any comments?
> 
> Deploy Tool Startup:
> =================
> * starting under JPDA debugger
> * allow jvm options to be passed
> 
> Currently the deploy tool accepts some parameters with two leading minus 
> characters (e.g. --user system).  The Tomcat startup scripts currently 
> have parameters that have a single leading minus character (e.g. 
> -security).  Should the startup script parameters be using the same prefix 
> (two leading minus characters) as the Java code or should it be using a 
> different prefix?
> 
> John
> 
> This e-mail message and any attachments may contain confidential, 
> proprietary or non-public information.  This information is intended 
> solely for the designated recipient(s).  If an addressing or transmission 
> error has misdirected this e-mail, please notify the sender immediately 
> and destroy this e-mail.  Any review, dissemination, use or reliance upon 
> this information by unintended recipients is prohibited.  Any opinions 
> expressed in this e-mail are those of the author personally.

Re: Startup Scripts discussion ( GERONIMO-693 )

Posted by toby cabot <to...@caboteria.org>.
On Tue, Jul 05, 2005 at 12:27:58PM +1100, sissonj@insession.com wrote:
> The startup script should have the following on the first line to instruct 
> the system which shell interpreter we are using.
> #! /bin/sh

Some systems allow whitespace between bang and slash, some don't, so
you'll be more portable if you use "#!/bin/sh".  OTOH the ones that
don't probably don't have JRE's ;)

Re: Startup Scripts discussion ( GERONIMO-693 )

Posted by David Blevins <da...@visi.com>.
Doesn't matter to me, going to symlink that puppy into /usr/local/bin on my machine anyway -- without the extention :)


-David


On Mon, Jul 04, 2005 at 09:50:09PM -0400, Aaron Mulder wrote:
> 	I'm in favor of the .sh extension for shell scripts
> 
> Aaron
> 
> On Mon, 4 Jul 2005, Jeff Genender wrote:
> > sissonj@insession.com wrote:
> > > Are you concerned that we may change shells in the future?
> > > 
> > > The startup script should have the following on the first line to instruct 
> > > the system which shell interpreter we are using.
> > > #! /bin/sh
> > > 
> > > It seems that a lot of applications use the .sh extension (except Apache 
> > > HTTPD's apachectl):
> > > Tomcat -  catalina.sh
> > > Apache HTTPD - apachectl
> > > WebSphere - startServer.sh
> > > WebLogic - startWebLogic.sh
> > > JBoss - run.sh
> > > 
> > > A number of benefits of using an extension are:
> > > a) easy to find shell script files, just search for files ending in .sh
> > > b) makes it easier to chmod all script files due to previous point.
> > > c) easier for FTP clients to automatically determine whether to use ascii 
> > > or binary transfers.
> > > d) could make it easier for svn property defaults, e.g.  *.sh = 
> > > svn:eol-style=native
> > > 
> > > I would be interested in the opinions of others on this topic.
> > 
> > I would supply the token .sh and .bat files.
> > 
> > Jeff
> > 

Re: Startup Scripts discussion ( GERONIMO-693 )

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
	I'm in favor of the .sh extension for shell scripts

Aaron

On Mon, 4 Jul 2005, Jeff Genender wrote:
> sissonj@insession.com wrote:
> > Are you concerned that we may change shells in the future?
> > 
> > The startup script should have the following on the first line to instruct 
> > the system which shell interpreter we are using.
> > #! /bin/sh
> > 
> > It seems that a lot of applications use the .sh extension (except Apache 
> > HTTPD's apachectl):
> > Tomcat -  catalina.sh
> > Apache HTTPD - apachectl
> > WebSphere - startServer.sh
> > WebLogic - startWebLogic.sh
> > JBoss - run.sh
> > 
> > A number of benefits of using an extension are:
> > a) easy to find shell script files, just search for files ending in .sh
> > b) makes it easier to chmod all script files due to previous point.
> > c) easier for FTP clients to automatically determine whether to use ascii 
> > or binary transfers.
> > d) could make it easier for svn property defaults, e.g.  *.sh = 
> > svn:eol-style=native
> > 
> > I would be interested in the opinions of others on this topic.
> 
> I would supply the token .sh and .bat files.
> 
> Jeff
> 

Re: Startup Scripts discussion ( GERONIMO-693 )

Posted by Jeff Genender <jg...@savoirtech.com>.
sissonj@insession.com wrote:
> Are you concerned that we may change shells in the future?
> 
> The startup script should have the following on the first line to instruct 
> the system which shell interpreter we are using.
> #! /bin/sh
> 
> It seems that a lot of applications use the .sh extension (except Apache 
> HTTPD's apachectl):
> Tomcat -  catalina.sh
> Apache HTTPD - apachectl
> WebSphere - startServer.sh
> WebLogic - startWebLogic.sh
> JBoss - run.sh
> 
> A number of benefits of using an extension are:
> a) easy to find shell script files, just search for files ending in .sh
> b) makes it easier to chmod all script files due to previous point.
> c) easier for FTP clients to automatically determine whether to use ascii 
> or binary transfers.
> d) could make it easier for svn property defaults, e.g.  *.sh = 
> svn:eol-style=native
> 
> I would be interested in the opinions of others on this topic.

I would supply the token .sh and .bat files.

Jeff

Re: Startup Scripts discussion ( GERONIMO-693 )

Posted by si...@insession.com.
David Blevins <da...@visi.com> wrote on 05/07/2005 12:54:29 PM:

> On Mon, Jul 04, 2005 at 06:48:21PM -0700, Jeremy Boynes wrote:
> > sissonj@insession.com wrote:
> > >toby cabot <to...@caboteria.org> wrote on 05/07/2005 12:59:14 AM:
> > >>
> > >>I like the idea of using a well-known baseline for the Geronimo
> > >>scripts, but could we call the shell script "geronimo" instead of
> > >>"geronimo.sh"?  I prefer to not expose the implementation (shell
> > >>script) in the interface.
> > >
> > >
> > >Are you concerned that we may change shells in the future?
> > >
> > >The startup script should have the following on the first line 
toinstruct 
> > >the system which shell interpreter we are using.
> > >#! /bin/sh
> > >
> > 
> > Not every version of Unix places the shell in the same place which can 

> > make this problematic.
> > 
> > #!/bin/sh should work for most, /provided to stick to sh/ and don't 
use 
> > ksh or bash extensions (just in case you happen to get a genuine sh 
> > implementation).

So is anyone not ok with specifying #!/bin/sh ?  If someone is on an 
obscure platform where this doesn't work, then they can set up a link or 
edit the script.

AFAIK if we ensure that the scripts only use original Bourne shell (sh) 
functionality then they should be compatible with other shells that may be 
linked to bin/sh such as ksh and bash, as they implement the Bourne shell 
environment.  Does that sound right?  If so, I will include some comments 
in the script so that people who edit it in the future are less likely to 
break it.

John
> > 
> 
> Right.  And just an reminder, Linux and OSX don't actually have sh on
> the machine, it's just bash symlinked (linux) or copied (osx).
> 
> Something to remember when testing the script.
> 
> -David


This e-mail message and any attachments may contain confidential, 
proprietary or non-public information.  This information is intended 
solely for the designated recipient(s).  If an addressing or transmission 
error has misdirected this e-mail, please notify the sender immediately 
and destroy this e-mail.  Any review, dissemination, use or reliance upon 
this information by unintended recipients is prohibited.  Any opinions 
expressed in this e-mail are those of the author personally.


Re: Startup Scripts discussion ( GERONIMO-693 )

Posted by David Blevins <da...@visi.com>.
On Mon, Jul 04, 2005 at 06:48:21PM -0700, Jeremy Boynes wrote:
> sissonj@insession.com wrote:
> >toby cabot <to...@caboteria.org> wrote on 05/07/2005 12:59:14 AM:
> >>
> >>I like the idea of using a well-known baseline for the Geronimo
> >>scripts, but could we call the shell script "geronimo" instead of
> >>"geronimo.sh"?  I prefer to not expose the implementation (shell
> >>script) in the interface.
> >
> >
> >Are you concerned that we may change shells in the future?
> >
> >The startup script should have the following on the first line to instruct 
> >the system which shell interpreter we are using.
> >#! /bin/sh
> >
> 
> Not every version of Unix places the shell in the same place which can 
> make this problematic.
> 
> #!/bin/sh should work for most, /provided to stick to sh/ and don't use 
> ksh or bash extensions (just in case you happen to get a genuine sh 
> implementation).
> 

Right.  And just an reminder, Linux and OSX don't actually have sh on
the machine, it's just bash symlinked (linux) or copied (osx).

Something to remember when testing the script.

-David

Re: Startup Scripts discussion ( GERONIMO-693 )

Posted by Jeremy Boynes <jb...@apache.org>.
sissonj@insession.com wrote:
> toby cabot <to...@caboteria.org> wrote on 05/07/2005 12:59:14 AM:
>>
>>I like the idea of using a well-known baseline for the Geronimo
>>scripts, but could we call the shell script "geronimo" instead of
>>"geronimo.sh"?  I prefer to not expose the implementation (shell
>>script) in the interface.
> 
> 
> Are you concerned that we may change shells in the future?
> 
> The startup script should have the following on the first line to instruct 
> the system which shell interpreter we are using.
> #! /bin/sh
> 

Not every version of Unix places the shell in the same place which can 
make this problematic.

#!/bin/sh should work for most, /provided to stick to sh/ and don't use 
ksh or bash extensions (just in case you happen to get a genuine sh 
implementation).

--
Jeremy

Re: Startup Scripts discussion ( GERONIMO-693 )

Posted by si...@insession.com.
toby cabot <to...@caboteria.org> wrote on 05/07/2005 12:59:14 AM:

> On Mon, Jul 04, 2005 at 11:22:59PM +1100, sissonj@insession.com wrote:
> > what do people think 
> > about basing the startup scripts (as much as possible) on tomcat's 
> > catalina.bat & catalina.sh 
> > 
http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/catalina/src/bin/
> > (since they have been used for years and many users would be familiar 
with 
> > their style of configuration)?
> 
> I like the idea of using a well-known baseline for the Geronimo
> scripts, but could we call the shell script "geronimo" instead of
> "geronimo.sh"?  I prefer to not expose the implementation (shell
> script) in the interface.

Are you concerned that we may change shells in the future?

The startup script should have the following on the first line to instruct 
the system which shell interpreter we are using.
#! /bin/sh

It seems that a lot of applications use the .sh extension (except Apache 
HTTPD's apachectl):
Tomcat -  catalina.sh
Apache HTTPD - apachectl
WebSphere - startServer.sh
WebLogic - startWebLogic.sh
JBoss - run.sh

A number of benefits of using an extension are:
a) easy to find shell script files, just search for files ending in .sh
b) makes it easier to chmod all script files due to previous point.
c) easier for FTP clients to automatically determine whether to use ascii 
or binary transfers.
d) could make it easier for svn property defaults, e.g.  *.sh = 
svn:eol-style=native

I would be interested in the opinions of others on this topic.

Thanks for the feedback.

John
> 
> Thanks,
> Toby


Re: Startup Scripts discussion ( GERONIMO-693 )

Posted by toby cabot <to...@caboteria.org>.
On Mon, Jul 04, 2005 at 11:22:59PM +1100, sissonj@insession.com wrote:
> what do people think 
> about basing the startup scripts (as much as possible) on tomcat's 
> catalina.bat & catalina.sh 
> http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/catalina/src/bin/ 
> (since they have been used for years and many users would be familiar with 
> their style of configuration)?

I like the idea of using a well-known baseline for the Geronimo
scripts, but could we call the shell script "geronimo" instead of
"geronimo.sh"?  I prefer to not expose the implementation (shell
script) in the interface.

Thanks,
Toby

Re: Startup Scripts discussion ( GERONIMO-693 )

Posted by si...@insession.com.
sissonj@insession.com wrote on 04/07/2005 10:22:59 PM:

<snip>
> 
> Deploy Tool Startup: 
> ================= 
> * starting under JPDA debugger 
> * allow jvm options to be passed 
> 

Should we be invoking the deploy tool with the following (taken from 
GERONIMO-502)?

java -Djava.security.manager 
-Djava.security.policy=var/security/deployer.policy  -jar bin/deployer.jar 
<standard> switches and parameters

If so, slightly off topic, it appears that we would then need the izpack 
installation to substitute the port numbers the user enters in the 
installer panels into var/security/deployer.policy for ease of 
installation. Not sure if we need to make changes to izpack (see link 
below) to support variable substitution in policy files (AFAIK, policy 
files are supposed to be in UTF8 encoding scheme, so the izpack 
VariableSubstitutor class may need to be enhanced to have a 
TYPE_JAVA_POLICY that defaults to UTF8 encoding.

http://cvs.berlios.de/cgi-bin/viewcvs.cgi/izpack/izpack-src/src/lib/com/izforge/izpack/util/VariableSubstitutor.java?rev=1.4&content-type=text/vnd.viewcvs-markup

If not, why, and should we have a command line switch that turns the 
security manager on?

Thanks,

John


> Currently the deploy tool accepts some parameters with two leading 
> minus characters (e.g. --user system).  The Tomcat startup scripts 
> currently have parameters that have a single leading minus character
> (e.g. -security).  Should the startup script parameters be using the
> same prefix (two leading minus characters) as the Java code or 
> should it be using a different prefix? 
> 
> John 
> 
This e-mail message and any attachments may contain confidential, 
proprietary or non-public information.  This information is intended 
solely for the designated recipient(s).  If an addressing or transmission 
error has misdirected this e-mail, please notify the sender immediately 
and destroy this e-mail.  Any review, dissemination, use or reliance upon 
this information by unintended recipients is prohibited.  Any opinions 
expressed in this e-mail are those of the author personally.