utilities: Manage OVN log ownership with tmpfiles.d#311
Open
zhhuabj wants to merge 1 commit into
Open
Conversation
ovn-ctl and ovn-lib currently chown the OVN log directory recursively when services start. That can undo ownership set by distribution tooling such as tmpfiles.d and logrotate. In particular, Debian and Ubuntu need ovn-controller.log to remain root:adm so rsyslog can read it, but a later OVN service restart may change it back to the OVN daemon user/group. Add OVN tmpfiles.d and sysusers.d templates for the log directory, ovn-controller.log and the configured log owner/group. The log user, log group, tmpfiles.d installation directory and sysusers.d installation directory are configurable so downstream packages can choose their local policy. Debian configures the log owner as root:adm and installs the generated sysusers.d file for the adm group. Fedora/RHEL keeps openvswitch:openvswitch for log ownership, but leaves the openvswitch user to the Open vSwitch package's sysusers.d configuration. Stop recursively changing the OVN log directory ownership from ovn-ctl and ovn-lib at service startup. Runtime, database and configuration paths are still chowned according to --ovn-user, preserving the existing privilege-drop behavior for non-log state. Reported-at: ovn-org#310 Signed-off-by: Zhang Hua <joshua.zhang@canonical.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ovn-ctl and ovn-lib currently chown the OVN log directory recursively when services start. That can undo ownership set by distribution tooling such as tmpfiles.d and logrotate. In particular, Debian and Ubuntu need ovn-controller.log to remain root:adm so rsyslog can read it, but a later OVN service restart may change it back to the OVN daemon user/group.
Add an OVN tmpfiles.d template for the log directory and ovn-controller.log, with configurable log user, log group and tmpfiles.d installation directory. Debian configures the log owner as root:adm, while Fedora/RHEL keeps openvswitch:openvswitch.
Stop recursively changing the OVN log directory ownership from ovn-ctl and ovn-lib at service startup. Runtime, database and configuration paths are still chowned according to --ovn-user, preserving the existing privilege-drop behavior for non-log state.
Reported-at: #310