I created an issue for this (CLEREZZA-502) and supplied a solution using
Java Service Wrapper.

I would need people to test it on different systems however. I tested it
extensively on my Ubuntu 10.10 64bit machine and partially on a Win XP 32bit
Virtual machine.

The installation instructions can be found in the comments to CLEREZZA-502:
https://issues.apache.org/jira/browse/CLEREZZA-502

Other questions are how to automate the installation tasks best in the
context of Clerezza (karaf has a nice solution but it's still some work to
implement the same in Clerezza).

Also I am not quite sure how to deal with licensing issues of Java Service
Wrapper. I did not modify or include any source code of JSW but the clerezza
wrapper code depends on the wrapper.jar library which is included in the
resource folder. This library is licensed under GPLv2. Any ideas what needs
to be done and wether it can be included in this way?

Best
Daniel

On Thu, Apr 21, 2011 at 1:11 AM, Reto Bachmann-Gmuer <
[email protected]> wrote:

> The karaf wrapper feature [1] looks nice too, on my system it create
> scripts
> and the following output:
>
> karaf@root> wrapper:install
> Creating file: /home/reto/lib/apache-karaf-2.2.0/bin/karaf-wrapper
> Creating file: /home/reto/lib/apache-karaf-2.2.0/bin/karaf-service
> Creating file: /home/reto/lib/apache-karaf-2.2.0/etc/karaf-wrapper.conf
> Creating file: /home/reto/lib/apache-karaf-2.2.0/lib/libwrapper.so
> Creating file: /home/reto/lib/apache-karaf-2.2.0/lib/karaf-wrapper.jar
> Creating file: /home/reto/lib/apache-karaf-2.2.0/lib/karaf-wrapper-main.jar
>
> Setup complete.  You may want to tweak the JVM properties in the wrapper
> configuration file:
>    /home/reto/lib/apache-karaf-2.2.0/etc/karaf-wrapper.conf
> before installing and starting the service.
>
> The way the service is installed depends upon your flavor of Linux.
>
> On Redhat/Fedora/CentOS Systems:
>  To install the service:
>    $ ln -s /home/reto/lib/apache-karaf-2.2.0/bin/karaf-service /etc/init.d/
>    $ chkconfig karaf-service --add
>
>  To start the service when the machine is rebooted:
>    $ chkconfig karaf-service on
>
>  To disable starting the service when the machine is rebooted:
>    $ chkconfig karaf-service off
>
>  To start the service:
>    $ service karaf-service start
>
>  To stop the service:
>    $ service karaf-service stop
>
>  To uninstall the service :
>    $ chkconfig karaf-service --del
>    $ rm /etc/init.d/karaf-service
>
> On Ubuntu/Debian Systems:
>  To install the service:
>    $ ln -s /home/reto/lib/apache-karaf-2.2.0/bin/karaf-service /etc/init.d/
>
>  To start the service when the machine is rebooted:
>    $ update-rc.d karaf-service defaults
>
>  To disable starting the service when the machine is rebooted:
>    $ update-rc.d -f karaf-service remove
>
>  To start the service:
>    $ /etc/init.d/karaf-service start
>
>  To stop the service:
>    $ /etc/init.d/karaf-service stop
>
>  To uninstall the service :
>    $ rm /etc/init.d/karaf-service
>
>
> Reto
>
> [1] https://cwiki.apache.org/KARAF/49-wrapper.html
>
> On Thu, Apr 21, 2011 at 12:45 AM, Reto Bachmann-Gmuer <
> [email protected]> wrote:
>
> > have a look at: http://activemq.apache.org/java-service-wrapper.html -
> > they include the gpl binary which seems to be ok licensewise.
> >
> > I think it would be nice if clerezza could easily be installed as a
> > service. Screen is a programm for people used to work on the command
> liine
> > there providing a script may slightlic reduce the number of lines needed
> to
> > enter at the price of non standard options and is likely to create
> difficult
> > to debug problems (such as ehn starting after multiple "su"s which causes
> > problems to screen) - I think its up to the os to make the usage of
> screen
> > easy, not to the application.
> >
> > reto
> >
> >
> > On Wed, Apr 20, 2011 at 1:49 PM, Daniel Spicar <
> [email protected]>wrote:
> >
> >> If we have a "deamonized" init-script for clerezza. Do we want to be
> able
> >> to
> >> "connect" to the felix/clerezza shell then? Normally deamons do not
> >> provide
> >> such a possibility. With clerezza it is possible to connect to the shell
> >> via
> >> ssh though provided the corresponding bundle is activated. Alternatively
> >> it
> >> is possible to use the shell via the felix web console.
> >>
> >> Something like that can be implemented with the java service wrapper
> [1].
> >> It
> >> is available as LGPL community version for open source projects.
> >>
> >> However if we want to use an approach like with screen, where we can
> start
> >> clerezza, put it in the background and attach to the console again, then
> I
> >> am not aware of any pre-made solutions for this. Does anybody know of
> one?
> >> I
> >> guess it would be possible to write a wrapper script for the
> corresponding
> >> screen commands on top of some "deamonize" script. But the disadvantage
> is
> >> that screen (or nohup) can not be used on (native) windows (only with
> >> cygwin
> >> afaik). So the solution would only work on unix (osx) systems. I have no
> >> experience on doing something like this for windows.
> >>
> >> Any suggestions/comments?
> >>
> >>
> >> [1] http://wrapper.tanukisoftware.com/doc/english/download.jsp
> >>
> >>
> >> On Wed, Apr 6, 2011 at 1:51 PM, Reto Bachmann-Gmuer <
> >> [email protected]> wrote:
> >>
> >> > On Wed, Apr 6, 2011 at 11:53 AM, Daniel Spicar <
> >> [email protected]
> >> > >wrote:
> >> >
> >> > > > I think we should provide instructions and/or support tools for
> >> > > installing
> >> > > > an init-script to have clerezza start automatically.
> >> > > >
> >> > > > Reto
> >> > > >
> >> > > >
> >> > > I made a launcher script, that is generated from the pop a while
> ago.
> >> > Maybe
> >> > > this is what we are lookihng for. It should work fine with nohup.
> >> Check
> >> > out
> >> > > this mail:
> >> > >
> >> > >
> >> >
> >>
> http://mail-archives.apache.org/mod_mbox/incubator-clerezza-dev/201010.mbox/%[email protected]%3E
> >> > >
> >> > I would welcome a patch to provide such scripts with clerezza.
> >> >
> >> > But the init script I was thinking at would be more something like :
> >> >
> >> >
> >>
> http://wiki.hudson-ci.org/display/HUDSON/Installing+Hudson+as+a+Unix+daemon
> >> >
> >> > or
> >> >
> >> >
> >>
> http://docs.codehaus.org/display/MAVENUSER/MavenProjectServer+Running+Tomcat+as+a+linux+service
> >> >
> >> > Cheers,
> >> > reto
> >> >
> >>
> >
> >
>

Reply via email to