Code Monkey home page Code Monkey logo

Comments (5)

yvesdm avatar yvesdm commented on July 17, 2024

Solution proposed -> see pull request.

Don't know if it is the way you wanted to solve this as I changed the mode java to mode jvm.
So open questions are

  • I don't know the reason why java mode was choosen instead of jvm (may be you had a good reason, and may be you prefer to make it configurable -> but will requires to update documentation)
  • I don't know if the list of path to jvm.dll is complete -> see findJvmDll(), and don't know if returnon "auto" is a good idea.

But I tested on my windows 7, 64 bits, and it works as expected.

Let me know if you have any remarks.

from capsule-daemon.

circlespainter avatar circlespainter commented on July 17, 2024

The main reason for java was to allow running the application as a service under an account without the LogonAsService privilege. Thanks for the PR, an alternative I was thinking about was to simply fix the documentation to state that start/stop methods don't apply to Windows.

What is your use case for start/stop methods under Windows?

from capsule-daemon.

yvesdm avatar yvesdm commented on July 17, 2024

My use case is : run an Apache Camel based application as a windows service.
So I have a start method to launch Camel, and another one to stop it.

  • Using the java way requires to develop IPC (inter process communication) as the main method is called to start and stop the process. It means, one JVM is launched to start the application,and another JVM is launched to handle the stop request. We need an IPC between both of them to notify the first one to shutdown.
  • Using the jvm way, it starts only one JVM it means start and stop will executes under the same context, and may use same object instances. It is more easyier in my use case.

But you are true, it breaks the feature LogonAsService. To provide both features (start/stop method and LogonAsService, the mode should became configurable and the doc should be updated. But should be easy to do :)

from capsule-daemon.

yvesdm avatar yvesdm commented on July 17, 2024

Regarding the the feature LogonAsService,
There are 2 options available in procrun

  • --User : enables running applications as a service under an account without the LogonAsService privilege
  • --ServiceUser the name of the account under which the service should run

Note : I see both of them are currently available in the capsule daemon.

If we choose for mode JVM, I guess the jvm will run under the user specified in ServiceUser and then having the same feature.

Do you have any specific use case where an application should be run in Java mode instead of in JVM mode ?

from capsule-daemon.

circlespainter avatar circlespainter commented on July 17, 2024

No specific use case (yet) but I'd avoid dropping --User without understanding the consequences, which I don't really understand; also, I can't test on a Windows system right now. Is the matter any clearer to you and do you have a chance of testing your PR with --ServiceUser with an account lacking the LogonAsService privilege?

I still think the best solution would be to add a mode option as you suggested though.

from capsule-daemon.

Related Issues (12)

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.