Skip to content

utilities: Manage OVN log ownership with tmpfiles.d#311

Open
zhhuabj wants to merge 1 commit into
ovn-org:mainfrom
zhhuabj:log_permission
Open

utilities: Manage OVN log ownership with tmpfiles.d#311
zhhuabj wants to merge 1 commit into
ovn-org:mainfrom
zhhuabj:log_permission

Conversation

@zhhuabj

@zhhuabj zhhuabj commented Jul 1, 2026

Copy link
Copy Markdown

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

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant