2

till now i implement a fedora service which starts my OSGi when machine starts. I have problem with stopping it. I simply don't know how to stop equinox osgi from my terminal/shell script, when i execute service <osgi servicename> stop

I have a specific requirement, when i stop the OSGi i want to stop by bundles in particular sequence. I wrote a bundle stopper code, but how i call it from outside the osgi terminal ?

i tried with telnet, but not approved solution.

sailor
  • 753
  • 1
  • 6
  • 17
  • See this similar question: http://stackoverflow.com/questions/1916432/best-way-to-shutdown-an-osgi-container-specifically-equinox – Dave Oct 19 '12 at 13:43
  • apart from stopping osgi there is no similarity, my problem is different, i want to stop osgi container from outside the osgi. how i can send my exit command on osgi terminal. do i need ipc ? – sailor Oct 19 '12 at 16:46

2 Answers2

1

You can use the community edition of Java Service Wrapper. Using WrapperStartStopApp or WrapperListener should fit your needs.

szhem
  • 4,672
  • 2
  • 18
  • 30
0

The simplest way is to use Apache Karaf. It can be configured to use Equinox under the hood and comes with init scripts you can use to start and stop it.

With pure Equinox you have to implement it yourself. There is a good code project that shows how to do it. http://code.google.com/p/equinox-headless-service/

Christian Schneider
  • 19,420
  • 2
  • 39
  • 64