-
Notifications
You must be signed in to change notification settings - Fork 58
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
diod: do not daemonize, do not syslog #130
Conversation
Problem: diod_sock.c defined some globals for TCP Wrappers, but support for it was removed so they are now unused. Drop the unused globals.
Problem: diod can log directly to syslog, but these days that can be handled in other ways. For example, stderr is typically redirected to the systemd journal, which can be redirected to syslog. Drop the direct syslog logging capability from diod. Drop syslog.h from several source files. Update unit test.
Problem: logging to syslog is deprecated but man pages still describe it, and it appears in the example config file. Drop syslog from the man pages. Change the example log config to a filename.
Problem: diod puts itself in the background by default, but this can be confusing and unexpected when running the service manually. In fact, given that systemd can manage daemons running in the foreground, it is probably no longer useful at all. Drop the --foreground option and never daemonize. Update tests.
Problem: diod dropped its --foreground option but the man page still describes it. Drop it from the man page.
Problem: diod now runs in the foreground, but systemd thinks it is going to fork. Change to Type=exec. See also systemd.exec(5).
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.
LGTM! I guess diod is only used on Linux?
People do run diod on FreeBSD (or have in the past) and in busy box environments where there is no systemd. However I don't think that poses a problem:
I should have noted that in the description, so thanks for bringing it up. There is also the fact that philosophically speaking 9P is about as far as you can get from the "toss it all in" apparent guiding principle of systemd so I wouldn't want to imply that it's required for diod! |
Thanks for the clarification! |
Since systemd (and probably other pid ones) can manage daemons running in the foreground and capture stderr, drop diod's capability to daemonize and log to syslog to keep things simple.
As a bonus it avoid the unexpected WTF? when you manually run
diod
and nothing apparently happens (because it backgrounded itself).