Sunday, May 11, 2014

run karaf 3.0.1 as a service (daemon) in a AWS CE2 CentOS.

karaf@root()> feature:install wrapper
karaf@root()> wrapper:install -s AUTO_START -n KARAF -d Karaf -D "Karaf Service"
Creating file: /home/ming/apache-karaf-3.0.1/bin/KARAF-wrapper
Creating file: /home/ming/apache-karaf-3.0.1/bin/KARAF-service
Creating file: /home/ming/apache-karaf-3.0.1/etc/KARAF-wrapper.conf
Creating file: /home/ming/apache-karaf-3.0.1/lib/libwrapper.so
Creating file: /home/ming/apache-karaf-3.0.1/lib/karaf-wrapper.jar
Creating file: /home/ming/apache-karaf-3.0.1/lib/karaf-wrapper-main.jar

Setup complete.  You may wish to tweak the JVM properties in the wrapper configuration file:
     /home/ming/apache-karaf-3.0.1/etc/KARAF-wrapper.conf
before installing and starting the service.


On Redhat/Fedora/CentOS Systems:
  To install the service:
    $ ln -s /home/ming/apache-karaf-3.0.1/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/ming/apache-karaf-3.0.1/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