Questions tagged [apache-commons-daemon]

an alternative invocation mechanism for unix-daemon-like java code.

62 questions
5
votes
1 answer

Is it possible to start a Java Runtime Image with prunsrv using jvm mode?

Background: Since Java 9 it is possible to create custom runtime images (JRE+program) using jlink. It is possible to install Java programs as Windows service using prunsrv.exe (part of Apache Commons Daemon). prunsrv can be used in three start…
Gustave
  • 2,787
  • 4
  • 27
  • 56
5
votes
1 answer

Can Apache Daemon be used to restart a Java application if it is forcibly shutdown?

I'm looking into Apache Daemon to help me with a Java app, and I just wanted to get some ideas/hints about what is possible. I want to create a simplified application that shows some kind of failsafe ability. The application will go through 4 steps…
Caffeinated
  • 10,270
  • 37
  • 107
  • 197
5
votes
1 answer

Using multiple jars in the jsvc classpath

I am trying to get a Java application to run as a Linux service using jsvc. I found How to convert a java program to daemon with jsvc? which was able to get me most of the way, but I am still struggling to get the classpath figured out. I am getting…
5
votes
1 answer

Daemonizing java application with JSVC

I'm trying to daemonize my application using Apache Commons Daemon using the Daemon interface. Java application it self isn't doing anything just writes to stout. I compiled jsvc: http://people.apache.org/~mturk/daemon-1.0.10/ (even tried newest…
user987220
  • 207
  • 2
  • 10
4
votes
1 answer

Spring Boot Application as a Daemon Service?

I'm a new who are getting started learning Spring Boot. I'm feeling that It's really helpful and great tool to develop Java application easily. On the other hand, I'm considering developing a Daemon Service which collects data/message(s) from Apache…
3
votes
1 answer

waitpid - In which cases both WIFEXITED and WIFSIGNALED will be false?

I'm running a Java program as a daemon on Linux using Apache commons-daemon's jsvc. The daemon "randomly" crashes with only message: jsvc.exec error: Service did not exit cleanly This is the relevant part of the code in jsvc (in jsvc-unix.c line…
nicoulaj
  • 3,061
  • 4
  • 23
  • 31
3
votes
1 answer

Procrun with org.apache.commons.daemon.Daemon

I wrote a Daemon by using the apache commons sample code: public class LockDaemon implements Daemon { @Override public void init(DaemonContext context) throws DaemonInitException, Exception { LogManager.getLogger().info("initialized with…
gorootde
  • 3,660
  • 3
  • 32
  • 71
3
votes
3 answers

Commons-Daemon procrun binaries missing with prunsrv.exe or prunmgr.exe

I am planning to create windows based service using commons-daemon procrun . I downloaded the commons-daemon-1.0.10-bin.zip file from downloads, but when I extracted it, I could not find prunsrv.exe or prunmgr.exe files. I found those were missing…
developer
  • 9,003
  • 29
  • 80
  • 144
2
votes
0 answers

NanoHTTP as windows service with Apache Commons Daemon

I made a small HTTP listener with NanoHTTP library, I would like to use it with Apache Commons Daemon (https://commons.apache.org/proper/commons-daemon/index.html) to install with procrun as Windows service. I read the docs but I cannot understand…
Tobia
  • 8,015
  • 24
  • 90
  • 182
2
votes
1 answer

How to add JNI hooks to one jar generated by Spring Boot

I am using Spring Boot gradle plugin (org.springframework.boot) to generate the "one" jar. It works well when I run java -jar app.jar - does exactly what's expected. However, this application should be running as a daemon using Apache Commons Daemon…
2
votes
2 answers

Set Windows service's working directory

I'm using Apache Commons Daemon's procrun to wrap a Java application as a Windows service. The issue I am having is related to the working directory of the service which is C:\Windows\system32. The configuration files needed by the service are…
jzonthemtn
  • 3,048
  • 15
  • 27
2
votes
1 answer

Howto setup a Daemon implementation as windows service

I didn't find any really good example (actually I did not find a single example) on how to register a class that implements the org.apache.commons.daemon.Daemon interface as Windows service. Do I have to register this implementation using procrun?…
dpr
  • 8,675
  • 3
  • 32
  • 57
2
votes
2 answers

running Scala with commons-daemon from jsvc

I'm trying to write a basic Scala application that can run as a daemon using commons-daemon. The following code was based on the java program in this post package daemon import org.apache.commons.daemon._ import java.util.{ Timer, TimerTask, Date…
awfulHack
  • 829
  • 1
  • 10
  • 24
2
votes
3 answers

Windows Service - Apache commons daemon class not found

I have a Jar file that needs to be installed as a windows service. I'm using Apache commons daemon procrun. Though the service appears in the Services tab in task manager its not running. Its in stopped state and attempting to start it seems not…
helloworld
  • 945
  • 5
  • 14
  • 31
2
votes
0 answers

Does Commons-Daemon exist to make your executable JAR a service?

Say I have an executable JAR called myapp.jar. Does Apache Commons-Daemon exist so that I could then write a /etc/init.d/myapp service script (for starting/stopping a myapp service), and then treat myapp like a regular Linux service: service myapp…
1
2 3 4 5