Code Monkey home page Code Monkey logo

capsule-daemon's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

capsule-daemon's Issues

Application-Script Daemon Capsule

Hi,
I'm not at all sure this is a capsule-daemon issue and not a result of my erroneous configuration, or an issue with us.kirchmeier.capsule, however I'm a bit stuck so any advice would be great.
The capsule produced by the following task results in the exception below.

task fatDaemonCapsule(type: FatCapsule) {
    capsuleManifest {
        platform('windows') {
            applicationScript = "mongoose-free-6.1.exe"
        }
        caplets << 'DaemonCapsule'
        manifest {
            attributes('Application-Name': project.serviceName)
            attributes('Daemon-Service-Name': project.serviceName)
            attributes('Daemon-Display-Name': project.serviceDisplay)
            attributes('Daemon-Description': project.serviceDesc)
            attributes('Daemon-Startup': 'auto')
            attributes('Daemon-Log-Level': 'debug')
        }
    }
}

CAPSULE: Jar: X:\workspaces\xxx\docs-rest-api\build\libs\docs-rest-api-0.0.0-SNAPSHOT-capsule.jar
CAPSULE: Platform: windows
CAPSULE: Loading caplet: DaemonCapsule
CAPSULE: Applying caplet DaemonCapsule
CAPSULE: Initializing app ID
CAPSULE: Initialized app ID: xxx
CAPSULE: Launching app xxx
CAPSULE: Starting capsule server.
CAPSULE: Binding capsule server at: 0.0.0.0:59332
CAPSULE: Using JVM: X:\@sdks\jdks\jdk1.8.0_5_dcevm\jre
CAPSULE: WARNING resolve [] was empty
CAPSULE: Cache directory: C:\Users\rodedb\AppData\Local\Temp
CAPSULE: Creating temp file/dir C:\Users\rodedb\AppData\Local\Temp\apps\xxx\.lock
CAPSULE: Locking C:\Users\rodedb\AppData\Local\Temp\apps\xxx\.lock
CAPSULE: Extracting X:\workspaces\xxx\docs-rest-api\build\libs\docs-rest-api-0.0.0-SNAPSHOT-capsule.jar to app cache directory C:\Users\rodedb\AppData\Local\Temp\apps\xxx
CAPSULE: Unlocking C:\Users\rodedb\AppData\Local\Temp\apps\xxx\.lock
CAPSULE: Cleanup
CAPSULE EXCEPTION: null while processing attribute Daemon-Service-Name: xxx
java.lang.NullPointerException
    at DaemonCapsule.setupWindowsCmd(DaemonCapsule.java:258)
    at DaemonCapsule.toSvc(DaemonCapsule.java:231)
    at DaemonCapsule.prelaunch(DaemonCapsule.java:154)
    at Capsule.prelaunch(Capsule.java:1476)
    at Capsule.prepareForLaunch(Capsule.java:1329)
    at Capsule.launch(Capsule.java:1258)
    at Capsule.main0(Capsule.java:394)
    at Capsule.main(Capsule.java:374)

The first issue encountered is that svcExec it not set (getJavaExecutable() isn't called), but even after dealing with that it still breaks due to not finding either of the Application of Application-Class attributes.
Am I missing something obvious?
Thanks

Allow system properties to be specified in the manifest

Hi circlespainter,

I'd like to suggest a feature/improvement:
It would be useful to be able to specify system properties in the jar manifest and have capsule-daemon utilize these as defaults if no system properties are specified in the command line.
e.g.

    capsuleManifest {
        caplets << "DaemonCapsule"
        // Linux
        systemProperties["capsule.daemon.debug"] = "true"
        systemProperties["capsule.daemon.verbose"] = "true"
        // System
        systemProperties["capsule.log"] = "verbose"
        systemProperties["capsule.daemon.stdoutFile"] = "/home/mudserver/logs/out.log"
        systemProperties["capsule.daemon.stderrFile"] = "/home/mudserver/logs/err.log"
    }

Thanks! :)

Add Daemon-User as a system property

Hi circlespainter,

I have another feature/suggestion:
It would be useful to be able to override the Daemon-User manifest property by using a system property. This would allow for different users depending on the server that the daemon is running.

e.g.
Windows) -Dcapsule.service.user=WindowsUser
Unix) -Dcapsule.service.user=UnixUser

Thanks! :)

Only `Application-Class` capsules are supported

When I am trying to run the following example
https://github.com/puniverse/capsule-runnable-war
wrapping it with the capsule-daemon I am getting the following exception:

This is the command that I run:
java -jar capsule-daemon-0.1.0.jar target/capsule-runnable-war-maven.war

This is the exception:
CAPSULE: Using JVM: /usr/lib/jvm/java-8-oracle/jre
CAPSULE: Cleanup
CAPSULE EXCEPTION: -1 while processing attribute Application-Class: null
java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.elementData(ArrayList.java:418)
at java.util.ArrayList.remove(ArrayList.java:495)
at DaemonCapsule.setupUnixCmd(DaemonCapsule.java:534)
at DaemonCapsule.toSvc(DaemonCapsule.java:197)
at DaemonCapsule.prelaunch(DaemonCapsule.java:144)
at Capsule.prelaunch(Capsule.java:1457)
at Capsule.prepareForLaunch(Capsule.java:1311)
at Capsule.launch(Capsule.java:1240)
at Capsule.main0(Capsule.java:391)
at Capsule.main(Capsule.java:370)

IllegalAccessError

Trying to include capsule-daemon as a caplet.

Have a fat jar with the capsule-daemon-0.1.0.jar embedded at root. And then the manifest entry, Caplets: co.paralleluniverse:capsule-daemon:0.1.0.

But when executing I get the following error:

CAPSULE EXCEPTION: tried to access method Capsule.copy(Ljava/io/InputStream;Ljava/io/OutputStream;)V from class DaemonCapsule
java.lang.IllegalAccessError: tried to access method Capsule.copy(Ljava/io/InputStream;Ljava/io/OutputStream;)V from class DaemonCapsule
    at DaemonCapsule.copy(DaemonCapsule.java:183)
    at DaemonCapsule.setupBinDir(DaemonCapsule.java:171)
    at DaemonCapsule.getJavaExecutable(DaemonCapsule.java:116)
    at Capsule.getJavaExecutable(Capsule.java:2245)
    at Capsule.buildJavaProcess(Capsule.java:2203)
    at Capsule.buildProcess0(Capsule.java:1519)
    at Capsule.buildProcess(Capsule.java:1510)
    at Capsule.buildProcess(Capsule.java:1510)
    at Capsule.buildProcess(Capsule.java:1510)
    at Capsule.buildProcess(Capsule.java:1510)
    at Capsule.buildProcess(Capsule.java:1510)
    at Capsule.buildProcess(Capsule.java:1510)
    at Capsule.prelaunch0(Capsule.java:1483)
    at Capsule.prelaunch(Capsule.java:1476)
    at Capsule.prelaunch(Capsule.java:1476)
    at Capsule.prelaunch(Capsule.java:1476)
    at Capsule.prelaunch(Capsule.java:1476)
    at Capsule.prelaunch(Capsule.java:1476)
    at DaemonCapsule.prelaunch(DaemonCapsule.java:141)
    at Capsule.prelaunch(Capsule.java:1476)
    at Capsule.prepareForLaunch(Capsule.java:1329)
    at Capsule.launch(Capsule.java:1258)
    at Capsule.main0(Capsule.java:394)
    at Capsule.main(Capsule.java:374)

Documentation of manifest entries

README references some manifest entries by a wrong name:
Daemon-Service-Display-Name and not Daemon-Service-Name
Daemon-Service-Description and not Daemon-Description

Daemon-Start-Method / Daemon-Stop-Method doesn't works with procrun !

Since the process is started/stopped in Java Mode : see DaemonCapsule.java

        installCmd.add(i++, "--StartMode");
        installCmd.add(i++, "Java");
...
        installCmd.add(i++, "--StopMode");
        installCmd.add(i++, "Java");

and according to the spec of procRun :

Name of method to be called when service is started. It must be static void and have argument (String args[]). Only applies to jvm mode - in Java mode, the main method is always used.
...
Name of method to be called when service is stopped. It must be static void and have argument (String args[]). Only applies to jvm mode. In Java mode, the main method is always used.

It will never works as expected.

Yves.

How the tool should behaves ?

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.

Add an option to stop the daemon

The daemon capsule can be used to start a daemon on Linux with JSVC, but it has no option to stop it. Currently, the daemon can be stopped by sending a signal or using JSVC stop command.
A capsule command option to stop the daemon could be useful.

Fails to run under Capsule 1.0.1 under OS/X

I'm using capsule 1.0.1 and when I run my capsule on OSX I get the following:

CAPSULE: Launching app com.smxemail.appsuite.vacationservice-1.0.1-SNAPSHOT-capsule
CAPSULE: Copying daemon native helpers [jsvc/linux64-brew/jsvc, jsvc/macosx-yosemite-brew/jsvc, procrun/prunsrv.exe] in /Users/amrk/.capsule/apps/com.smxemail.appsuite.vacationservice-1.0.1-SNAPSHOT-capsule/bin
CAPSULE: Creating temp file/dir /Users/amrk/.capsule/apps/com.smxemail.appsuite.vacationservice-1.0.1-SNAPSHOT-capsule/bin
CAPSULE: Unlocking /Users/amrk/.capsule/apps/com.smxemail.appsuite.vacationservice-1.0.1-SNAPSHOT-capsule/.lock
CAPSULE: Cleanup
CAPSULE EXCEPTION: tried to access method Capsule.copy(Ljava/io/InputStream;Ljava/io/OutputStream;)V from class DaemonCapsule
java.lang.IllegalAccessError: tried to access method Capsule.copy(Ljava/io/InputStream;Ljava/io/OutputStream;)V from class DaemonCapsule
  at DaemonCapsule.copy(DaemonCapsule.java:183)
  at DaemonCapsule.setupBinDir(DaemonCapsule.java:171)
  at DaemonCapsule.getJavaExecutable(DaemonCapsule.java:116)
  at Capsule.getJavaExecutable(Capsule.java:2245)
  at Capsule.buildJavaProcess(Capsule.java:2203)
  at Capsule.buildProcess0(Capsule.java:1519)
  at Capsule.buildProcess(Capsule.java:1510)
  at Capsule.buildProcess(Capsule.java:1510)
  at Capsule.buildProcess(Capsule.java:1510)
  at Capsule.buildProcess(Capsule.java:1510)
  at Capsule.prelaunch0(Capsule.java:1483)
  at Capsule.prelaunch(Capsule.java:1476)
  at Capsule.prelaunch(Capsule.java:1476)
  at Capsule.prelaunch(Capsule.java:1476)
  at DaemonCapsule.prelaunch(DaemonCapsule.java:141)
  at Capsule.prelaunch(Capsule.java:1476)
  at Capsule.prepareForLaunch(Capsule.java:1329)
  at Capsule.launch(Capsule.java:1258)
  at Capsule.main0(Capsule.java:394)
  at Capsule.main(Capsule.java:374)

I'm using the capsule-maven-plugin with the following basic configuration:

  <plugin>
    <groupId>com.github.chrischristo</groupId>
    <artifactId>capsule-maven-plugin</artifactId>
    <version>1.1.1</version>
    <executions>
      <execution>
        <goals>
          <goal>build</goal>
        </goals>
        <configuration>
          <appClass>com.smxemail.appsuite.vacationservice.VacationMessageService</appClass>
          <caplets>co.paralleluniverse:capsule-daemon:0.1.0</caplets>
          <chmod>true</chmod>
          <types>fat</types>
        </configuration>
      </execution>
    </executions>
  </plugin>

CentOS 6.7 (and possibly others) incompatibility of the `jsvc` binary shipped with `capsule-daemon`

Hi there,

I'm experiencing a compatibility issue with capsule-daemon and CentOS 6.7.
When executing my capsule.jar I receive the following error message:

/home/example/bin/jsvc/linux64-brew/jsvc: /lib64/libc.so.6: version 'GLIBC_2.14' not found (required by /home/server/bin/jsvc/linux64-brew/jsvc)
/home/example/bin/jsvc/linux64-brew/jsvc: /lib64/libc.so.6: version 'GLIBC_2.15' not found (required by /home/example/bin/jsvc/linux64-brew/jsvc)

I believe this is occurring because the jsvc executable that is embedded in capsule-daemon is not compatible with the version of glibc that CentOS 6.7 uses. If this is the case would it be possible to either embed a compatible version of jsvc in capsule-daemon or allow the user to specify an external jsvc executable?

CentOS release 6.7 (Final)
x86_64 GNU/Linux
GLIBC version: 2.12-1.166.el6_7.3

Many thanks for your assistance :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.