Hi Aleksandr-

What's the advantage of a native daemon over just wrapping it as a linux service script ?

Best
Alex


On 28/01/2016 11:32, Aleksandr Vasilev wrote:
Hello everyone!

I spent last few days looking at the solution to run Brooklyn process as a
daemon and found two options:
1. Run daemon via Apache Commons Daemon (jsvc)
2. Write a custom daemon in C

Both solutions has its own pros and cons, so let's look at what I think
they are:

JSVC:
Pros:
- Ready to use solution. Running a daemon via jsvc is very similar to
running java application from the command line with similar arguments
passed.
- Builds as usual in Maven

Cons:
- Still requires you to write daemon code, which in my opinion kills the
out-of-the-box usability
- Has tons of bugs, including: not been able to find classes in classpath,
not been able to run by non-root users, not been able to run on several
*nix systems (Mac OS, BSD)
- The codebase hasn't changed since 2013 and seems abandoned
- SVN repo often isn't accessible for some reason, right now the webserver
returns 503 error code:
http://svn.apache.org/viewvc/commons/proper/daemon/trunk/

Custom Daemon (written in C):
Pros:
- Cross-platform, runs on any *nix system supported by Brooklyn
- Very little code to maintain
- Independent from third-party solutions, requires only gcc to build
- Easy to make LSB-compliant init scripts to control the daemon

Cons:
- Requires some overhead to build C code in Maven

Having all these options considered, I propose writing daemon for Apache
Brooklyn in C language and use gcc compiler to build it. It will require
introducing some changes to Maven build process, but there are plenty of
solutions for doing this, such as Maven NAR plugin, which is actively
maintained:
https://github.com/maven-nar/nar-maven-plugin

Best Regards,
Aleksandr Vasilev
DevOps Engineer | Cloudsoft Corporation


Reply via email to