6 ms·
Call me around the year 3004 when they add unix datagram sockets, fork(), and native support for syslog… so that one can implement sane server software.
by bombolo 4y ago
Call me around the year 3004 when they add unix datagram sockets, fork(), and native support for syslog… so that one can implement sane server software.
- adra 4y agoUnix 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.
- pjmlp 4y agoNone of that is required for Cloud development, yet another one that missed the irrelevancy of POSIX in modern software development.
- bombolo 4y agoAh, so you don't use systemd? Just because you don't know about something and never learnt how to use it, it doesn't make it irrelevant.
- re-thc 4y agoChances are it's a Kubernetes pod using containers these days :)
- bombolo 4y agoYes with a /dev/log unix datagram socket mounted from the host and forwarded to a log collector that java can't connect to, so instead stdout is redirected but it doesn't support log levels.
- pjmlp 4y agoBetter go tell that to Amazon, Google and Azure.
- bombolo 4y agoUnsurprisingly, it seems after all people do logging with syslog (as if there was any doubt) https://www.ibm.com/cloud/blog/kubernetes-log-forwarding-syslog https://www.ibm.com/cloud/blog/kubernetes-log-forwarding-sys...
- pjmlp 4y agoNot much experience with IBM Cloud it seems, dumping a random blog post from 2017, here you go how we actually do it in modern times, https://cloud.ibm.com/docs/log-analysis?topic=log-analysis-log_analysis_agent https://cloud.ibm.com/docs/log-analysis?topic=log-analysis-l...