puniverse / capsule-daemon

A caplet that will run a capsule as a daemon
http://capsule.io
14 stars 4 forks source link

How the tool should behaves ? #7

Closed ihommani closed 8 years ago

ihommani commented 8 years ago

Hi,

I am trying to wrap a capsule with the capsule daemon, but the behavior I get is rather odd. No process seems to be spawned although launching the capsule containing the main class works.

Here the log I get with the command line inside. log.txt

The log is telling me about a bin folder and a pid file, that I can't find. I'm running on an Archlinux 4.3.3-2-ARCH

The capsule I want to launch is a spring-boot application. What I expect from using the capsule-daemon is to launch the spring boot application's capsule as a daemon. Is it possible ?

Thx for your help.

circlespainter commented 8 years ago

Sure, have you tried running with the -Dcapsule.daemon.debug=true flag? There are also a few important notes to take into account, towards the end of the README:

  • jsvc with default settings (due to the default PID file location) and procrun in any case (for service installation, uninstallation and upgrade) require resp. root and administrative privileges.
  • Launch, Java and service execution users must all be able to access the same Capsule's cache directory. You can set it to a commonly accessible location (for example in /tmp/capsule) through the CAPSULE_CACHE_DIR environment variable.
ihommani commented 8 years ago

Indeed I get more info with the debug flag. Thx for the tip. Daemon loader seems to be found, and daemon loaded suscessfully. However it can't start and fail on an InvocationTargetException.

Launching the capsule alone works. From what I read in the error stack trace, the problem comes from the application contained in the 'main' capsule. What do you think ,? log.txt

Could it be linked to lack of rights on jsvc ?

circlespainter commented 8 years ago

The ultimate cause seems to be an exception thrown by your app's main ("Caused by: org.springframework.boot.devtools.restart.SilentExitExceptionHandler$SilentExitException"), maybe related to some Spring Boot development-time auto-restart mechanism (I'm not very knowledgeable about Spring Boot)?

ihommani commented 8 years ago

Alright. Yes seems like it's due to Spring boot plumbery. The last error I got is related to a failure when starting the embeded Tomcat.

Have you encountered previously this specific case where a capsuled application spawns an embeded server to serve itself ?

circlespainter commented 8 years ago

Yes sure, I usually run tests about capsules and caplets also with quasar-stocks which is an embedded server too.

ihommani commented 8 years ago

Ok, it's working now. I think that the tomcat startup was failing because the port on which it wanted to start was alredy taken. Thx for the support.