-
Notifications
You must be signed in to change notification settings - Fork 18
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
add support to log via syslog for daemons #185
Conversation
This is especially useful for albatross-tls-endpoint in inetd mode, where stdout is occupied with client communication
maybe @reynir has an opinion on this... otherwise I'll merge once CI is fine :) |
@@ -166,7 +166,7 @@ let ip = | |||
Arg.(value & opt ip_c Ipaddr.(V6 V6.unspecified) & info [ "ip" ] ~doc) | |||
|
|||
let inetd = | |||
let doc = "Inetd mode" in | |||
let doc = "Inetd mode. Be sure to use `--syslog` (or `--quiet` to disable logging)" in |
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.
Is it perhaps worth it to check this is the case?
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.
Would c12a53f be fine in that regard? The issue is that you'll only see exit code 3... since the tls-endpoint binary is only ever called by inetd where stdout (and stderr I believe) are not available anymore...
So, actually I'm not sure whether it is worth to have this check in the code.
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.
Ah this opens another can of worms. If you pass invalid flags/arguments to albatross-tls-endpoint I think cmdliner will print out help messages?! I think to stderr. If so then that's as well problematic.
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.
Maybe another approach is to have a albatross-tls-endpoint-inetd
that is a symlink to albatross-tls-endpoint
and match on Sys.argv.(0)
to determine if we're -inetd
and then pass to Cmdliner.Cmd.eval
null formatters ~help
and ~err
and set inetd mode.
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.
I wouldn't overengineer this. :) Given that for e.g. Linux and systemd we have the socket activation, the inetd mode is mostly a relict for our FreeBSD server :)
…g or logs=quiet is true
CHANGES: * BUGFIX install tls_endpoint as systemd service (not only as example), fix typo (robur-coop/albatross#183 @PizieDust) * BUGFIX albatross-influx: use "cow_faults" (fixed typo in robur-coop/albatross#182) as unsigned integer (b9695dd9c267f5e59f18154a632adba0481f9d72, @hannesm) * BUGFIX albatross-influx: avoid empty measurement (robur-coop/albatross#182 @hannesm) * BUGFIX tls-endpoint: don't fail if a bad client connects (robur-coop/albatross#180 @hannesm) * FEATURE tls-endpoint: add syslog support (esp. useful for inetd) (robur-coop/albatross#185 @hannesm) * FEATURE Update to FreeBSD 14 (robur-coop/albatross#172, @hannesm) * BUGFIX update command: make usable with local client (robur-coop/albatross#184, @reynir) * BUGFIX update command: handle HTTP not found explicitly (fixes robur-coop/albatross#147, robur-coop/albatross#171 @hannesm) * FEATURE Albatross: record start timestamp via info (fixes robur-coop/albatross#168, robur-coop/albatross#169 @hannesm) * BUGFIX Albatross: store timestamp as generalized time instead of utc time (robur-coop/albatross#167 @hannesm @reynir, adjusted by robur-coop/albatross#181 for backwards compatibility @PizieDust) * BUGFIX FreeBSD: restart services when they terminate (@hannesm, 64f28fbd88504ec33d6bfde5211684e0ba1bc193) * BUGFIX packaging: install albatross-client as albatross-client (@hannesm, 23acb8b3edbe0153e1bd24a1736b80e73a27e33f) * update nix inputs (robur-coop/albatross#175, robur-coop/albatross#179 @Julow) * use ohex instead of hex (robur-coop/albatross#174 @hannesm) * fix README (robur-coop/albatross#177 @PizieDust, 2a1c3d898b586946ce7c4f3171ea5eb856f4ade8, 107c235eb94e83d6a077c42ee8b527c207af4ba7)
CHANGES: * BUGFIX install tls_endpoint as systemd service (not only as example), fix typo (robur-coop/albatross#183 @PizieDust) * BUGFIX albatross-influx: use "cow_faults" (fixed typo in robur-coop/albatross#182) as unsigned integer (b9695dd9c267f5e59f18154a632adba0481f9d72, @hannesm) * BUGFIX albatross-influx: avoid empty measurement (robur-coop/albatross#182 @hannesm) * BUGFIX tls-endpoint: don't fail if a bad client connects (robur-coop/albatross#180 @hannesm) * FEATURE tls-endpoint: add syslog support (esp. useful for inetd) (robur-coop/albatross#185 @hannesm) * FEATURE Update to FreeBSD 14 (robur-coop/albatross#172, @hannesm) * BUGFIX update command: make usable with local client (robur-coop/albatross#184, @reynir) * BUGFIX update command: handle HTTP not found explicitly (fixes robur-coop/albatross#147, robur-coop/albatross#171 @hannesm) * FEATURE Albatross: record start timestamp via info (fixes robur-coop/albatross#168, robur-coop/albatross#169 @hannesm) * BUGFIX Albatross: store timestamp as generalized time instead of utc time (robur-coop/albatross#167 @hannesm @reynir, adjusted by robur-coop/albatross#181 for backwards compatibility @PizieDust) * BUGFIX FreeBSD: restart services when they terminate (@hannesm, 64f28fbd88504ec33d6bfde5211684e0ba1bc193) * BUGFIX packaging: install albatross-client as albatross-client (@hannesm, 23acb8b3edbe0153e1bd24a1736b80e73a27e33f) * update nix inputs (robur-coop/albatross#175, robur-coop/albatross#179 @Julow) * use ohex instead of hex (robur-coop/albatross#174 @hannesm) * fix README (robur-coop/albatross#177 @PizieDust, 2a1c3d898b586946ce7c4f3171ea5eb856f4ade8, 107c235eb94e83d6a077c42ee8b527c207af4ba7)
This is especially useful for albatross-tls-endpoint in inetd mode, where stdout is occupied with client communication
Fixes #176