You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by Lionel Cons <li...@cern.ch> on 2011/05/13 08:44:03 UTC

Packaging/scripts cleanup suggestions

Hiram,

I'm experimenting with rpm packaging of Apollo and I have a few suggestions
regarding the three scripts currently in use (apollo, apollo-broker and
apollo-broker-service).

First, apollo-broker-service contains some code that may evolve (see
AMQ-3317 ;-) and should IMHO be located under APOLLO_HOME so that it can get
upgraded when a new software version gets installed. Of course, we would
still need a wrapper under APOLLO_BASE.

Then, now that we use apollo.profile, the apollo-broker and
apollo-broker-service scripts could be the same across different broker
instances provided that "apollo create" puts the specific things
(i.e. APOLLO_HOME and APOLLO_USER) in apollo.profile.

By combining both points above, we see that apollo-broker and
apollo-broker-service become in fact identical (they just guess APOLLO_BASE
and call their counterpart under APOLLO_HOME). This unique wrapper script
could also be located under APOLLO_HOME.

Finally, I think that the scripts under APOLLO_HOME and APOLLO_BASE should
have the same name since the ones under APOLLO_BASE simply call the ones
under APOLLO_HOME in the end...

Putting all this together (with a bit of name cleanup), we could have:
 - APOLLO_HOME/bin/apollo stays as it is
 - APOLLO_HOME/bin/service would contain most of the current
   apollo-broker-service, without the APOLLO_BASE guessing
 - APOLLO_HOME/bin/wrapper would contain most of the current apollo-broker
   but exec in the end $progname instead of apollo
 - "apollo create" would:
    * create APOLLO_BASE/etc/apollo.profile with APOLLO_HOME and APOLLO_USER
    * copy APOLLO_HOME/bin/wrapper to APOLLO_BASE/bin/apollo
    * copy APOLLO_HOME/bin/wrapper to APOLLO_BASE/bin/service (could be hard link)

This way:
 - all the scripts are under the software tree (APOLLO_HOME)
 - all the settings are in one file (apollo.profile)
 - upgrading the scripts of a broker instance becomes trivial

What do you think?

Cheers,

Lionel

Re: Packaging/scripts cleanup suggestions

Posted by Lionel Cons <li...@cern.ch>.
Hiram Chirino writes:
 > I generally like the suggestions.  The one thing I worry about is that
 > I think folks might like to put the APOLLO_HOME/bin in their path, and
 > if that's the case I'd only want apollo to show up on the PATH.  We
 > probably want to put those new support scripts in a different location
 > under APOLLO_HOME.

Having another directory under APOLLO_HOME (like libexec) to put these
scripts in is possible but IMHO messy. Alternatively, you could prefix
them (e.g. wrapper -> apollo-wrapper) but IMHO it's not much cleaner.

What we plan to do here is the following:
 - Apollo version X gets installed under /usr/share/apollo-X
   (this way we can have multiple versions installed at the same time)
 - upon installation, rpm creates the symlink /usr/share/apollo -> apollo-X
   (this way /usr/share/apollo is always the default/latest installed
    Apollo to use => this is the default APOLLO_HOME)
 - upon installation, rpm creates the symlink /usr/bin/apollo -> /usr/share/apollo/bin/apollo
   (this way there is a default apollo command in the PATH if needed,
    although people would probably type the full path to choose the
    exact software version to use)

We plan to use only the apollo under APOLLO_BASE, not the one under
APOLLO_HOME. We will use the full path because it's the only way to
select which broker instance we want to interact with.

Cheers,

Lionel

Re: Packaging/scripts cleanup suggestions

Posted by Hiram Chirino <hi...@hiramchirino.com>.
Hi Lionel,

I generally like the suggestions.  The one thing I worry about is that
I think folks might like to put the APOLLO_HOME/bin in their path, and
if that's the case I'd only want apollo to show up on the PATH.  We
probably want to put those new support scripts in a different location
under APOLLO_HOME.


Regards,
Hiram

FuseSource
Web: http://fusesource.com/

Connect at CamelOne May 24-26
The Open Source Integration Conference



On Fri, May 13, 2011 at 2:44 AM, Lionel Cons <li...@cern.ch> wrote:
> Hiram,
>
> I'm experimenting with rpm packaging of Apollo and I have a few suggestions
> regarding the three scripts currently in use (apollo, apollo-broker and
> apollo-broker-service).
>
> First, apollo-broker-service contains some code that may evolve (see
> AMQ-3317 ;-) and should IMHO be located under APOLLO_HOME so that it can get
> upgraded when a new software version gets installed. Of course, we would
> still need a wrapper under APOLLO_BASE.
>
> Then, now that we use apollo.profile, the apollo-broker and
> apollo-broker-service scripts could be the same across different broker
> instances provided that "apollo create" puts the specific things
> (i.e. APOLLO_HOME and APOLLO_USER) in apollo.profile.
>
> By combining both points above, we see that apollo-broker and
> apollo-broker-service become in fact identical (they just guess APOLLO_BASE
> and call their counterpart under APOLLO_HOME). This unique wrapper script
> could also be located under APOLLO_HOME.
>
> Finally, I think that the scripts under APOLLO_HOME and APOLLO_BASE should
> have the same name since the ones under APOLLO_BASE simply call the ones
> under APOLLO_HOME in the end...
>
> Putting all this together (with a bit of name cleanup), we could have:
>  - APOLLO_HOME/bin/apollo stays as it is
>  - APOLLO_HOME/bin/service would contain most of the current
>   apollo-broker-service, without the APOLLO_BASE guessing
>  - APOLLO_HOME/bin/wrapper would contain most of the current apollo-broker
>   but exec in the end $progname instead of apollo
>  - "apollo create" would:
>    * create APOLLO_BASE/etc/apollo.profile with APOLLO_HOME and APOLLO_USER
>    * copy APOLLO_HOME/bin/wrapper to APOLLO_BASE/bin/apollo
>    * copy APOLLO_HOME/bin/wrapper to APOLLO_BASE/bin/service (could be hard link)
>
> This way:
>  - all the scripts are under the software tree (APOLLO_HOME)
>  - all the settings are in one file (apollo.profile)
>  - upgrading the scripts of a broker instance becomes trivial
>
> What do you think?
>
> Cheers,
>
> Lionel
>