5 ms·
Unix sockets were released in java 16 officially though it was always supported before that in third party software. C style fork() seems insane for any gc-typ
by adra 4y ago
Unix sockets were released in java 16 officially though it was always supported before that in third party software.
C style fork() seems insane for any gc-type languages, so ?? Threading in Java post virtual threads has been so pleasant that I'm like why would one bother?
The vast majority of applications use third party logging and many have the ability to call out to syslogd.
I'm not entirely interested that every language fits perfectly into the UNIX classical "everything's a process / pipe" style model.
- bombolo 4y ago> Unix sockets were released in java 16 officially though it was always supported before that in third party software. I said datagram, not stream. > C style fork() seems insane for any gc-type languages, so ?? java daemons have no way to signal systemd their readiness. The unix way is to fork and exit. The systemd specific way is to use dbus to tell systemd that the process is ready. java supports none of that natively. So if you have a service that depends on a java daemon, you can't sort them properly. The normal way is to hack the java daemon to be launched from a bash script, that will test if it's ready using curl or netcat, and will in turn tell systemd about it. As it is, doing a sane daemon in java is impossible without having some JNI fun. > I'm not entirely interested that every language fits perfectly into the UNIX classical "everything's a process / pipe" style model. Ok, how do you propose to tell systemd that your daemon is ready to accept connections?
- kaba0 4y ago> As it is, doing a sane daemon in java is impossible without having some JNI fun And there is a brand new Foreign Memory, Function API in Java (from project panama), which makes it quite possible and ergonomic.
- marwis 4y agoYou can use Type=dbus with pure java dbus client. Or just execute systemd-notify
- bombolo 4y agoAh i didn't know about systemd-notify as a binary! I don't want to use dbus as that'd be an extra external dependency. Equivalent of syslog() is still a problem without using external dependencies.