Package macOS launchd daemon with bundled jre

14 views
Skip to first unread message

Christoph Tönsing

unread,
Dec 2, 2020, 3:22:26 AM12/2/20
to The Luggage

I have been reading up on how to go about bundling an openjdk jre with a launchd daemon to be packaged for macos, but I seem to not be finding very clear information. The how-to's all seem to focus on bundling a jre for an .app application to be installed together with the jre into the /Applications folder and furthermore, each seem to go about things slightly differently.

What I am trying to accomplish is to use the luggage to build a .pkg package which installs a fat .jar as a launchd service. The pkg must also include the openjdk jre of a specific java version. Also, the service requires a bunch of files (config files, DB files, logs, external executables which are launched for certain tasks by the service etc.) Some of these are just for the service to read its config, some will be constantly updated as the service does its thing, like the DB files. The jre and all these other files must be available for the service at a particular location. From what I can gather, the luggage will copy a .plist file to /Library/LaunchDaemons from where launchd will then pick it up and according to the contents of the .plist file run a certain command after the machine starts for example.

My question is, where should all the other files, including the service .jar, go? In my mind it is reasonable to expect them all to be available at one location... Would this in fact be the way to do it? /etc/MyApp? /usr/local/etc/MyApp? Any guidance would be highly appreciated!

Reply all
Reply to author
Forward
0 new messages