Daemon
Support for starting, stopping, and controlling Java daemon processes on Unix/Linux
Install / Use
/learn @daveho/DaemonREADME
This is a really simple Java library for starting, stopping, and controlling
daemon processes written in Java on Unix/Linux. To allow your program
to run as a daemon, just link this library into your program.
The library does not use native code, nor does it require external
shell scripts. All OS-dependent functionality is implemented by executing
subprocesses, specifically sh, ps, and mkfifo.
The intended use is to make it easy to build deployable jar files for server or other long-running applications. For example, you might use this library as part of packaging your Java web application into a single jar file (using embedded Jetty): this library allows the application to run as a background process, handle runtime configuration commands, and to shut itself down cleanly. Once everything is set up you can then do cool things like the following:
# Start the application in the background
java -jar myApp.jar start
# Send a command (purgecache) to the running application
# (note that this is just an example: handling non-built-in
# commands is done by logic in your application)
java -jar myApp.jar purgecache
# Start (or restart) the application if it is not
# currently running (or has crashed)
java -jar myApp.jar poke
# Shut down the running application
java -jar myApp.jar shutdown
Detailed information can be found at the wiki.
The library is open source distributed under the MIT license.
David Hovemeyer david.hovemeyer@gmail.com
Related Skills
openhue
345.4kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
345.4kElevenLabs text-to-speech with mac-style say UX.
weather
345.4kGet current weather and forecasts via wttr.in or Open-Meteo
tweakcc
1.5kCustomize Claude Code's system prompts, create custom toolsets, input pattern highlighters, themes/thinking verbs/spinners, customize input box & user message styling, support AGENTS.md, unlock private/unreleased features, and much more. Supports both native/npm installs on all platforms.
