Packaging scm-manager

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Packaging scm-manager

Taahir Ahmed
Hi all,

I'm interested in packaging scm-manager [http://www.scm-manager.org/].  It's a
very nice java servlet that handles hosting git, mercurial, bazaar, and
subversion repositories.

I'm starting by writing an init script for my existing install (attached).  
I've got it mostly working, I think, but I am wondering if there's a gentoo-
approved way of setting a proper value for JAVA_HOME in the init script.

There is a file (/etc/profile.d/java-config-2.sh) that sets a value for
several java-related environment variables.  Is it good practice to source
this file from an init script?  Right now I'm just using a sub-shell call to
java-config to detect the active system vm.

Thanks,

Taahir Ahmed

scm-manager (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Packaging scm-manager

assabajanischer_hinterwaeldler
Hi Taahir,

iirc init scripts should read the given values from /etc/conf.d folder,
but it's definitly possible to access parts of the real filesystem. you
only have to take care to not exceed the root filesystem (at least it
lead to some failure in an init script i've written).
i'm not sure if this is the best idea, but placing a copy of the
JAVA_HOME value should work quiet well. to achieve this i see two ways:
1) setting the value within the depend part
2) append the update to the shutdown of this script

as i'm not sure when the depend is called this may lead to some errors,
if the things change. in both cases you have to take care, that the
necessary config values have be never written at all (hope there is a
feasible value). imo this should be a much cleaner way.
> BASEDIR=/home/scm-user/scm-server
> REPO="$BASEDIR"/lib
should definitely be placed within the config part to allow changes to it
without the need to modify the init script.

greets
martin


On Thu, Aug 08, 2013 at 06:48:24PM -0500, Taahir Ahmed wrote:
> I'm starting by writing an init script for my existing install (attached).  
> I've got it mostly working, I think, but I am wondering if there's a gentoo-
> approved way of setting a proper value for JAVA_HOME in the init script.
>
> There is a file (/etc/profile.d/java-config-2.sh) that sets a value for
> several java-related environment variables.  Is it good practice to source
> this file from an init script?  Right now I'm just using a sub-shell call to
> java-config to detect the active system vm.

Reply | Threaded
Open this post in threaded view
|

Re: Packaging scm-manager

James Le Cuirot-2
In reply to this post by Taahir Ahmed
On Thu, 08 Aug 2013 18:48:24 -0500
Taahir Ahmed <[hidden email]> wrote:

> I'm starting by writing an init script for my existing install
> (attached). I've got it mostly working, I think, but I am wondering
> if there's a gentoo- approved way of setting a proper value for
> JAVA_HOME in the init script. Right now I'm just using a
> sub-shell call to java-config to detect the active system vm.

That's what the Tomcat init script does and I don't think there's
anything wrong with that. It does effectively the same thing as
sourcing /etc/profile.d/java-config-2.sh would do but I don't think
there's any point in doing that because you will always want the system
VM in this case. Simple use /etc/java-config-2/current-system-vm as
your JAVA_HOME and you will get the same result. This location is a
symlinked directory.

I was going to suggest that you install a launcher wrapper in the
ebuild using java-pkg_dolauncher but this doesn't allow you to start
the process with jsvc because the wrapper is hardcoded to use "java". I
remember running into this issue before but decided not to use jsvc in
the end anyway.

Regards,
James

Reply | Threaded
Open this post in threaded view
|

Re: Packaging scm-manager

Taahir Ahmed
In reply to this post by Taahir Ahmed
On Thursday, August 08, 2013 18:48:24 PM Taahir Ahmed wrote:
> Hi all,
>
> I'm interested in packaging scm-manager [http://www.scm-manager.org/].  It's
a

> very nice java servlet that handles hosting git, mercurial, bazaar, and
> subversion repositories.
>
> I'm starting by writing an init script for my existing install (attached).  
> I've got it mostly working, I think, but I am wondering if there's a gentoo-
> approved way of setting a proper value for JAVA_HOME in the init script.
>
> There is a file (/etc/profile.d/java-config-2.sh) that sets a value for
> several java-related environment variables.  Is it good practice to source
> this file from an init script?  Right now I'm just using a sub-shell call to
> java-config to detect the active system vm.
>
> Thanks,
>
> Taahir Ahmed

One other thing: scm-manager uses maven.  Is there a maven eclass in the
works, or do I need to run it manually from src_configure/src_compile?

Thanks,

Taahir Ahmed