-
Notifications
You must be signed in to change notification settings - Fork 97
Linux: make davmail notify readyness to systemd #188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The build fails on windows as |
src/java/davmail/DavGateway.java
Outdated
try { | ||
Class.forName("davmail.util.SystemdNotify").getMethod("ready").invoke(null); | ||
} catch (Exception e) { | ||
LOGGER.warn("Running on a systemD host but could not notify reaydness."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Readiness" is misspelled here. Please fix.
Also, capitalizing the "d" in "systemd" is a bit unusual. Wikipedia refers to it as "systemd".
I suggest rephrasing the first part as "Running on a host with systemd" etc.
I think we need to consider a few different cases here (for Linux only).
I would argue that instead of trying to handle all the various cases, simply try to notify systemd. If it works, great. If it doesn't, then simply continue without any systemd special cases. The whole idea of checking for directories to see if systemd is used is bound to cause issues. If you really want to check, see if the environment variable The next step would then be to use the https://www.freedesktop.org/software/systemd/man/latest/sd_watchdog_enabled.html# |
My apologies for my comments arriving in bits and pieces. I unfortunately haven't had the time to sit down and think this through properly. If we are changing the I don't know enough about the various failure modes or why we wouldn't be able to notify systemd when run under it, but just to be friendly to the end user, I suggest bailing out with an informative error message. |
No description provided.