Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1, Test Ubuntu with the default '--disable-sysusers-log-ownership'
- Note: logrotate is from the debian ovn package (/bak/work/debian/ovn/debian/ovn-common.logrotate) rather than upstream ovn
- cd /bak/linux/ovn
- git submodule update --init
- cd /bak/linux/ovn/ovs
- make distclean || true
- ./boot.sh
- ./configure \
- --prefix=/usr \
- --localstatedir=/var \
- --sysconfdir=/etc \
- --disable-shared \
- --enable-static \
- CFLAGS="-g -O2 -fPIC"
- make python/ovs/dirs.py V=1
- make -j"$(nproc)"
- cd /bak/linux/ovn
- make distclean || true
- ./boot.sh
- ./configure \
- --prefix=/usr \
- --localstatedir=/var \
- --sysconfdir=/etc \
- --with-log-user=root \
- --with-log-group=adm \
- --with-ovs-source="$PWD/ovs" \
- --with-ovs-build="$PWD/ovs"
- make -j"$(nproc)"
- make check TESTSUITEFLAGS='-j'"$(nproc)"
- sudo apt install graphviz debhelper dh-autoreconf dh-python python3-all python3-sphinx libunbound-dev -y
- export DEB_BUILD_OPTIONS=nocheck
- export OVSDIR="$PWD/ovs"
- export EXTRA_CONFIGURE_OPTS="--with-ovs-source=$PWD/ovs --with-ovs-build=$PWD/ovs"
- sudo chown -R "$USER:$USER" /bak/linux/ovn
- sudo rm -rf debian/autoreconf.before debian/autoreconf.after
- dpkg-buildpackage -us -uc -b
- cd ..
- sudo apt install openvswitch-switch -y && test -r /usr/share/openvswitch/scripts/ovs-lib
- sudo apt install ./ovn-common_26.09.90-1_amd64.deb ./ovn-central_26.09.90-1_amd64.deb ./ovn-host_26.09.90-1_amd64.deb ./ovn-controller-vtep_26.09.90-1_amd64.deb -y
- sudo DEBIAN_FRONTEND=noninteractive dpkg -i --force-confnew ovn-host_26.09.90-1_amd64.deb
- sudo systemctl restart ovn-host ovn-central
- systemctl --no-pager --full status ovn-host ovn-central
- hua@y9000p:~$ cat /usr/lib/sysusers.d/ovn-sysusers.conf
- cat: /usr/lib/sysusers.d/ovn-sysusers.conf: No such file or directory
- hua@y9000p:~$ cat /usr/lib/tmpfiles.d/ovn-tmpfiles.conf
- # The setgid bit makes log files created in this directory inherit adm.
- d /var/log/ovn 2750 root adm -
- hua@y9000p:~$ ls -al /var/log/ovn/
- drwxr-s--- 2 root adm 4096 Oct 12 08:21 .
- drwxrwxr-x 24 root syslog 4096 Oct 12 06:11 ..
- -rw-r----- 1 root adm 1130 Oct 12 08:21 ovn-controller.log
- -rw-r----- 1 root adm 742 Oct 12 08:21 ovn-controller-vtep.log
- -rw-r----- 1 root adm 539 Oct 12 08:21 ovn-northd.log
- -rw-r----- 1 root adm 240 Oct 12 08:21 ovsdb-server-nb.log
- -rw-r----- 1 root adm 240 Oct 12 08:21 ovsdb-server-sb.log
- hua@y9000p:~$ sudo /usr/share/ovn/scripts/ovn-ctl stop_controller && sudo /usr/share/ovn/scripts/ovn-ctl start_controller && sudo /usr/share/ovn/scripts/ovn-ctl status_controller
- * Exiting ovn-controller (1621)
- * Starting ovn-controller
- ovn-controller is running with pid 1985
- hua@y9000p:~$ ls -al /var/log/ovn/
- drwxr-s--- 2 root adm 4096 Oct 12 08:21 .
- drwxrwxr-x 24 root syslog 4096 Oct 12 06:11 ..
- -rw-r----- 1 root adm 2465 Oct 12 08:22 ovn-controller.log
- -rw-r----- 1 root adm 742 Oct 12 08:21 ovn-controller-vtep.log
- -rw-r----- 1 root adm 539 Oct 12 08:21 ovn-northd.log
- -rw-r----- 1 root adm 444 Oct 12 08:21 ovsdb-server-nb.log
- -rw-r----- 1 root adm 447 Oct 12 08:21 ovsdb-server-sb.log
- # test logrotate (/etc/logrotate.d/ovn-common is from debian package rather than upstream ovn so we created it by hand)
- cat << EOF | sudo tee /etc/logrotate.d/ovn-common
- /var/log/ovn/ovn-controller.log {
- su root root
- daily
- rotate 1
- compress
- missingok
- create 0640 root adm
- postrotate
- if [ -d /var/run/ovn ]; then
- for ctl in /var/run/ovn/*.ctl; do
- ovs-appctl -t "$ctl" vlog/reopen 2>/dev/null || :
- done
- fi
- endscript
- }
- EOF
- sudo logrotate -f -v /etc/logrotate.d/ovn-common
- hua@y9000p:~$ ls -al /var/log/ovn/ | grep controller.log
- -rw-r----- 1 root adm 0 Oct 12 08:23 ovn-controller.log
- -rw-r----- 1 root adm 587 Oct 12 08:22 ovn-controller.log.1.gz
- 2, Test Ubuntu with '--enable-sysusers-log-ownership'
- cd /bak/linux/ovn
- git submodule update --init
- cd /bak/linux/ovn/ovs
- make distclean || true
- ./boot.sh
- ./configure \
- --prefix=/usr \
- --localstatedir=/var \
- --sysconfdir=/etc \
- --disable-shared \
- --enable-static \
- CFLAGS="-g -O2 -fPIC"
- make python/ovs/dirs.py V=1
- make -j"$(nproc)"
- cd /bak/linux/ovn
- make distclean || true
- ./boot.sh
- ./configure \
- --prefix=/usr \
- --localstatedir=/var \
- --sysconfdir=/etc \
- --with-log-user=root \
- --with-log-group=adm \
- --enable-sysusers-log-ownership \
- --with-ovs-source="$PWD/ovs" \
- --with-ovs-build="$PWD/ovs"
- make -j"$(nproc)"
- make check TESTSUITEFLAGS='-j'"$(nproc)"
- # add '--enable-sysusers-log-ownership' in EXTRA_CONFIGURE_OPTS when building deb package
- sudo apt install graphviz debhelper dh-autoreconf dh-python python3-all python3-sphinx libunbound-dev -y
- export DEB_BUILD_OPTIONS=nocheck
- export OVSDIR="$PWD/ovs"
- export EXTRA_CONFIGURE_OPTS="--with-ovs-source=$PWD/ovs --with-ovs-build=$PWD/ovs --enable-sysusers-log-ownership"
- sudo chown -R "$USER:$USER" /bak/linux/ovn
- sudo rm -rf debian/autoreconf.before debian/autoreconf.after
- dpkg-buildpackage -us -uc -b
- cd ..
- sudo apt install openvswitch-switch -y && test -r /usr/share/openvswitch/scripts/ovs-lib
- sudo apt remove --purge ovn-central ovn-host ovn-controller-vtep ovn-common -y && sudo rm -rf /var/log/ovn/*
- sudo apt install ./ovn-common_26.09.90-1_amd64.deb ./ovn-central_26.09.90-1_amd64.deb ./ovn-host_26.09.90-1_amd64.deb ./ovn-controller-vtep_26.09.90-1_amd64.deb -y
- sudo DEBIAN_FRONTEND=noninteractive dpkg -i --force-confnew ovn-host_26.09.90-1_amd64.deb
- systemctl --no-pager --full status ovn-host ovn-central
- # ovn-sysusers.conf has an empty line: '@SYSUSERS_GROUP_LINE@ -> g adm - && @SYSUSERS_USER_LINE@ -> empty' because root already exists
- hua@y9000p:~$ cat /root/v8-enabled/ovn/utilities/ovn-sysusers.conf
- g adm -
- hua@y9000p:~$ nl -ba /root/v8-enabled/ovn/utilities/ovn-sysusers.conf
- 1 g adm -
- 2
- hua@y9000p:~$ cat /usr/lib/tmpfiles.d/ovn-tmpfiles.conf
- # The setgid bit makes log files created in this directory inherit adm.
- d /var/log/ovn 2750 root adm -
- hua@y9000p:~$ ls -al /var/log/ovn/
- drwxr-s--- 2 root adm 4096 Oct 12 09:14 .
- drwxrwxr-x 24 root syslog 4096 Oct 12 06:11 ..
- -rw-r----- 1 root adm 805 Oct 12 09:14 ovn-controller.log
- -rw-r----- 1 root adm 742 Oct 12 09:14 ovn-controller-vtep.log
- -rw-r----- 1 root adm 539 Oct 12 09:14 ovn-northd.log
- -rw-r----- 1 root adm 240 Oct 12 09:14 ovsdb-server-nb.log
- -rw-r----- 1 root adm 240 Oct 12 09:14 ovsdb-server-sb.log
- hua@y9000p:~$ sudo /usr/share/ovn/scripts/ovn-ctl stop_controller && sudo /usr/share/ovn/scripts/ovn-ctl start_controller && sudo /usr/share/ovn/scripts/ovn-ctl status_controller
- * Exiting ovn-controller (940906)
- * Starting ovn-controller
- ovn-controller is running with pid 942118
- hua@y9000p:~$ ls -al /var/log/ovn/
- drwxr-s--- 2 root adm 4096 Oct 12 09:14 .
- drwxrwxr-x 24 root syslog 4096 Oct 12 06:11 ..
- -rw-r----- 1 root adm 2994 Oct 12 09:15 ovn-controller.log
- -rw-r----- 1 root adm 742 Oct 12 09:14 ovn-controller-vtep.log
- -rw-r----- 1 root adm 1269 Oct 12 09:15 ovn-northd.log
- -rw-r----- 1 root adm 676 Oct 12 09:15 ovsdb-server-nb.log
- -rw-r----- 1 root adm 676 Oct 12 09:15 ovsdb-server-sb.log
- # test logrotate (/etc/logrotate.d/ovn-common is from debian package rather than upstream ovn so we created it by hand)
- cat << EOF | sudo tee /etc/logrotate.d/ovn-common
- /var/log/ovn/ovn-controller.log {disable-sysusers-log-ownership
- su root root
- daily
- rotate 1
- compress
- missingok
- create 0640 root adm
- postrotate
- if [ -d /var/run/ovn ]; then
- for ctl in /var/run/ovn/*.ctl; do
- ovs-appctl -t "$ctl" vlog/reopen 2>/dev/null || :
- done
- fi
- endscript
- }
- EOF
- sudo logrotate -f -v /etc/logrotate.d/ovn-common
- hua@y9000p:~$ ls -al /var/log/ovn/ | grep controller.log
- -rw-r----- 1 root adm 0 Oct 12 09:15 ovn-controller.log
- -rw-r----- 1 root adm 517 Oct 12 09:14 ovn-controller.log.1.gz
- 3, Test Fedora with the default '--disable-sysusers-log-ownership'
- cd /bak/linux/ovn
- lxc image list images:fedora
- lxc launch images:fedora/44 fedora
- lxc file push -r /bak/linux/ovn fedora/root/
- lxc shell fedora
- dnf install -y rpm-build make gcc gcc-c++ autoconf automake libtool systemd-rpm-macros openssl openssl-devel python3-devel git tar gzip bzip2 xz \
- desktop-file-utils groff graphviz checkpolicy selinux-policy-devel python3-sphinx procps-ng libcap-ng libcap-ng-devel unbound unbound-devel
- cd /root/ovn/ovs
- rm -f Makefile config.status config.log libtool aclocal.m4
- rm -f config.cache config.h config.h.in stamp-h1
- rm -rf autom4te.cache
- find . -name '.deps' -type d -prune -exec rm -rf {} +
- find . -name '.libs' -type d -prune -exec rm -rf {} +
- find . -name '*.o' -o -name '*.lo' -o -name '*.la' | xargs -r rm -f
- ./boot.sh
- ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc
- make dist
- cd /root/ovn
- rm -f Makefile config.status config.log libtool aclocal.m4
- rm -f config.cache config.h config.h.in stamp-h1
- rm -rf autom4te.cache
- find . -path './ovs' -prune -o -name '.deps' -type d -prune -exec rm -rf {} +
- find . -path './ovs' -prune -o -name '.libs' -type d -prune -exec rm -rf {} +
- find . -path './ovs' -prune -o \( -name '*.o' -o -name '*.lo' -o -name '*.la' \) -print | xargs -r rm -f
- ./boot.sh
- ./configure \
- --prefix=/usr \
- --localstatedir=/var \
- --sysconfdir=/etc \
- --with-ovs-source=/root/ovn/ovs \
- --with-ovs-build=/root/ovn/ovs \
- --with-log-user=openvswitch \
- --with-log-group=openvswitch
- make rpm-fedora RPMBUILD_OPT="--without check"
- find /root/ovn/rpm/rpmbuild/RPMS -type f -name '*.rpm' -print
- find /root/ovn/rpm/rpmbuild/SRPMS -type f -name '*.rpm' -print
- for rpm in /root/ovn/rpm/rpmbuild/RPMS/*/*.rpm; do
- echo "== $rpm =="
- rpm -qpl "$rpm" | grep 'ovn-tmpfiles.conf' || true
- done
- ls /root/ovn/rpm/rpmbuild/RPMS/x86_64/ovn-26.09.90-1.fc44.x86_64.rpm
- [root@fedora ovn]# rpm -qlp /root/ovn/rpm/rpmbuild/RPMS/x86_64/ovn-26.09.90-1.fc44.x86_64.rpm | grep conf
- /etc/sysconfig/ovn
- /usr/lib/tmpfiles.d/ovn-tmpfiles.conf
- [root@fedora ovn]# rpm -ql openvswitch | grep sysuser
- /usr/lib/sysusers.d/openvswitch.conf
- dnf remove -y logrotate && rm -rf /etc/logrotate.d/ovn && dnf install -y logrotate
- dnf reinstall -y /root/ovn/rpm/rpmbuild/RPMS/x86_64/ovn-26.09.90-1.fc44.x86_64.rpm
- dnf reinstall -y /root/ovn/rpm/rpmbuild/RPMS/x86_64/ovn-debuginfo-26.09.90-1.fc44.x86_64.rpm
- dnf reinstall -y /root/ovn/rpm/rpmbuild/RPMS/x86_64/ovn-host-*.rpm
- systemctl start openvswitch.service && systemctl start ovn-controller.service
- rpm -ql ovn | grep tmpfiles
- cat /usr/lib/systemd/system/ovn-controller.service
- cat /etc/logrotate.d/ovn
- systemctl list-unit-files '*ovn*'
- systemctl cat ovn-controller.service
- [root@fedora ovn]# cat /usr/lib/sysusers.d/ovn-sysusers.conf
- cat: /usr/lib/sysusers.d/ovn-sysusers.conf: No such file or directory
- [root@fedora ovn]# cat /usr/lib/tmpfiles.d/ovn-tmpfiles.conf
- # The setgid bit makes log files created in this directory inherit openvswitch.
- d /var/log/ovn 2750 openvswitch openvswitch -
- [root@fedora ovn]# cat /usr/lib/sysusers.d/openvswitch.conf
- #Type Name ID GECOS Home directory Shell
- u openvswitch - "Open vSwitch Daemons" / /sbin/nologin
- g hugetlbfs -
- m openvswitch hugetlbfs
- [root@fedora ovn]# ls -ld /var/log/ovn
- drwxr-s--- 2 openvswitch openvswitch 4096 Oct 12 08:05 /var/log/ovn
- [root@fedora ovn]# ls -l /var/log/ovn/ovn-controller.log
- -rw-r----- 1 openvswitch openvswitch 89 Oct 12 08:05 /var/log/ovn/ovn-controller.log
- logrotate -f /etc/logrotate.d/ovn -v
- [root@fedora ovn]# ls -ld /var/log/ovn
- drwxr-s--- 2 openvswitch openvswitch 4096 Oct 12 08:06 /var/log/ovn
- [root@fedora ovn]# ls -l /var/log/ovn/ovn-controller.log*
- -rw-r----- 1 openvswitch openvswitch 89 Oct 12 08:06 /var/log/ovn/ovn-controller.log
- 4, Test Fedora with the default '--enable-sysusers-log-ownership'
- cd /bak/linux/ovn
- lxc image list images:fedora
- lxc launch images:fedora/44 fedora
- lxc file push -r /bak/linux/ovn fedora/root/
- lxc shell fedora
- dnf install -y rpm-build make gcc gcc-c++ autoconf automake libtool systemd-rpm-macros openssl openssl-devel python3-devel git tar gzip bzip2 xz \
- desktop-file-utils groff graphviz checkpolicy selinux-policy-devel python3-sphinx procps-ng libcap-ng libcap-ng-devel unbound unbound-devel
- cd /root/ovn/ovs
- rm -f Makefile config.status config.log libtool aclocal.m4
- rm -f config.cache config.h config.h.in stamp-h1
- rm -rf autom4te.cache
- find . -name '.deps' -type d -prune -exec rm -rf {} +
- find . -name '.libs' -type d -prune -exec rm -rf {} +
- find . -name '*.o' -o -name '*.lo' -o -name '*.la' | xargs -r rm -f
- ./boot.sh
- ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc
- make dist
- cd /root/ovn
- rm -f Makefile config.status config.log libtool aclocal.m4
- rm -f config.cache config.h config.h.in stamp-h1
- rm -rf autom4te.cache
- find . -path './ovs' -prune -o -name '.deps' -type d -prune -exec rm -rf {} +
- find . -path './ovs' -prune -o -name '.libs' -type d -prune -exec rm -rf {} +
- find . -path './ovs' -prune -o \( -name '*.o' -o -name '*.lo' -o -name '*.la' \) -print | xargs -r rm -f
- ./boot.sh
- ./configure \
- --prefix=/usr \
- --localstatedir=/var \
- --sysconfdir=/etc \
- --with-ovs-source=/root/ovn/ovs \
- --with-ovs-build=/root/ovn/ovs \
- --with-log-user=openvswitch \
- --with-log-group=openvswitch
- # pass '--with ovn_sysusers' to enable sysusers
- make rpm-fedora RPMBUILD_OPT="--without check --with ovn_sysusers"
- find /root/ovn/rpm/rpmbuild/RPMS -type f -name '*.rpm' -print
- find /root/ovn/rpm/rpmbuild/SRPMS -type f -name '*.rpm' -print
- for rpm in /root/ovn/rpm/rpmbuild/RPMS/*/*.rpm; do
- echo "== $rpm =="
- rpm -qpl "$rpm" | grep 'ovn-tmpfiles.conf' || true
- done
- ls /root/ovn/rpm/rpmbuild/RPMS/x86_64/ovn-26.09.90-1.fc44.x86_64.rpm
- [root@fedora ovn]# rpm -qlp /root/ovn/rpm/rpmbuild/RPMS/x86_64/ovn-26.09.90-1.fc44.x86_64.rpm | grep conf
- /etc/sysconfig/ovn
- /usr/lib/sysusers.d/ovn-sysusers.conf
- /usr/lib/tmpfiles.d/ovn-tmpfiles.conf
- [root@fedora ovn]# rpm -ql openvswitch | grep sysuser
- /usr/lib/sysusers.d/openvswitch.conf
- dnf remove -y logrotate && rm -rf /etc/logrotate.d/ovn && dnf install -y logrotate
- dnf reinstall -y /root/ovn/rpm/rpmbuild/RPMS/x86_64/ovn-26.09.90-1.fc44.x86_64.rpm
- dnf reinstall -y /root/ovn/rpm/rpmbuild/RPMS/x86_64/ovn-debuginfo-26.09.90-1.fc44.x86_64.rpm
- dnf reinstall -y /root/ovn/rpm/rpmbuild/RPMS/x86_64/ovn-host-*.rpm
- systemctl start openvswitch.service && systemctl start ovn-controller.service
- rpm -ql ovn | grep tmpfiles
- cat /usr/lib/systemd/system/ovn-controller.service
- cat /etc/logrotate.d/ovn
- systemctl list-unit-files '*ovn*'
- systemctl cat ovn-controller.service
- [root@fedora ovn]# cat /usr/lib/sysusers.d/ovn-sysusers.conf
- g openvswitch -
- u openvswitch -:openvswitch "OVN log user" -
- [root@fedora ovn]# cat /usr/lib/tmpfiles.d/ovn-tmpfiles.conf
- # The setgid bit makes log files created in this directory inherit openvswitch.
- d /var/log/ovn 2750 openvswitch openvswitch -
- [root@fedora ovn]# cat /usr/lib/sysusers.d/openvswitch.conf
- #Type Name ID GECOS Home directory Shell
- u openvswitch - "Open vSwitch Daemons" / /sbin/nologin
- g hugetlbfs -
- m openvswitch hugetlbfs
- [root@fedora ovn]# ls -ld /var/log/ovn
- drwxr-s--- 2 openvswitch openvswitch 4096 Oct 12 08:08 /var/log/ovn
- [root@fedora ovn]# ls -l /var/log/ovn/ovn-controller.log
- -rw-r----- 1 openvswitch openvswitch 2727 Oct 12 08:08 /var/log/ovn/ovn-controller.log
- logrotate -f /etc/logrotate.d/ovn -v
- [root@fedora ovn]# ls -ld /var/log/ovn
- drwxr-s--- 2 openvswitch openvswitch 4096 Oct 12 08:09 /var/log/ovn
- [root@fedora ovn]# ls -l /var/log/ovn/ovn-controller.log
- -rw-r----- 1 openvswitch openvswitch 89 Oct 12 08:09 /var/log/ovn/ovn-controller.log
- 5, Test scenarios without systemd services (Direct 'make install')
- Note: When building directly via ./configure without arguments, both tmpfiles and sysusers default to disabled.
- Manual ./configure without arguments:
- tmpfiles=off, sysusers=off
- Debian dpkg-buildpackage:
- tmpfiles=on, sysusers=off
- Fedora default RPM:
- tmpfiles=on, sysusers=off
- Manual test options:
- --enable-tmpfiles-log-ownership
- --enable-sysusers-log-ownership
- lxc launch images:ubuntu/24.04 noble
- lxc file push -r /bak/linux/ovn noble/root/
- lxc exec noble bash
- apt update
- apt install -y autoconf automake bison build-essential libcap-ng-dev libssl-dev libtool pkg-config python3 python3-six libunbound-dev libunwind-dev strace
- cd /root/ovn
- git submodule update --init
- cd /root/ovn/ovs
- make distclean || true
- rm -rf /usr/lib/tmpfiles.d/ovn-tmpfiles.conf && rm -rf /usr/lib/sysusers.d/ovn-sysusers.conf
- ./boot.sh
- ./configure \
- --prefix=/usr \
- --localstatedir=/var \
- --sysconfdir=/etc \
- --disable-shared \
- --enable-static \
- CFLAGS="-g -O2 -fPIC"
- make -j"$(nproc)"
- make install
- ls /usr/share/openvswitch/scripts/ovs-lib
- # First run --enable-sysusers-log-ownership and --enable-tmpfiles-log-ownership (ovn_chown_logdir is 'no')
- cd /root/ovn
- make distclean || true
- rm -rf /usr/lib/tmpfiles.d/ovn-tmpfiles.conf && rm -rf /usr/lib/sysusers.d/ovn-sysusers.conf
- ./boot.sh
- ./configure \
- --prefix=/usr \
- --localstatedir=/var \
- --sysconfdir=/etc \
- --with-log-user=root \
- --with-log-group=adm \
- --enable-sysusers-log-ownership \
- --enable-tmpfiles-log-ownership \
- --with-ovs-source="$PWD/ovs" \
- --with-ovs-build="$PWD/ovs"
- make -j"$(nproc)"
- make check-local TESTSUITEFLAGS='-k ovn-ctl'
- make install
- root@noble:~/ovn# grep '^ovn_chown_logdir=' /usr/share/ovn/scripts/ovn-lib
- ovn_chown_logdir='no'
- root@noble:~/ovn# ls /usr/lib/sysusers.d/ovn-sysusers.conf
- /usr/lib/sysusers.d/ovn-sysusers.conf
- root@noble:~/ovn# cat /usr/lib/sysusers.d/ovn-sysusers.conf
- g adm -
- root@noble:~/ovn# ls /usr/lib/tmpfiles.d/ovn-tmpfiles.conf
- /usr/lib/tmpfiles.d/ovn-tmpfiles.conf
- root@noble:~/ovn# cat /usr/lib/tmpfiles.d/ovn-tmpfiles.conf
- # The setgid bit makes log files created in this directory inherit adm.
- d /var/log/ovn 2750 root adm -
- systemd-tmpfiles --create --prefix=/var/log/ovn
- /usr/share/ovn/scripts/ovn-ctl --no-monitor start_controller
- root@noble:~/ovn# stat -c '%a %U:%G %n' /var/log/ovn /var/log/ovn/ovn-controller.log
- 2750 root:adm /var/log/ovn
- 640 root:adm /var/log/ovn/ovn-controller.log
- /usr/share/ovn/scripts/ovn-ctl stop_controller || true
- rm -rf /var/log/ovn
- systemd-tmpfiles --create --prefix=/var/log/ovn
- /usr/share/ovn/scripts/ovn-ctl --no-monitor start_controller
- root@noble:~/ovn# stat -c '%a %U:%G %n' /var/log/ovn /var/log/ovn/ovn-controller.log
- 2750 root:adm /var/log/ovn
- 640 root:adm /var/log/ovn/ovn-controller.log
- # Next run --disable-tmpfiles-log-ownership and --disable-sysusers-log-ownership (ovn_chown_logdir is 'yes')
- cd /root/ovn
- make distclean || true
- rm -rf /usr/lib/tmpfiles.d/ovn-tmpfiles.conf && rm -rf /usr/lib/sysusers.d/ovn-sysusers.conf
- ./configure \
- --prefix=/usr \
- --localstatedir=/var \
- --sysconfdir=/etc \
- --disable-tmpfiles-log-ownership \
- --disable-sysusers-log-ownership \
- --with-ovs-source="$PWD/ovs" \
- --with-ovs-build="$PWD/ovs"
- make -j"$(nproc)"
- make install
- root@noble:~/ovn# grep '^ovn_chown_logdir=' /usr/share/ovn/scripts/ovn-lib
- ovn_chown_logdir='yes'
- root@noble:~/ovn# ls /usr/lib/tmpfiles.d/ovn-tmpfiles.conf
- ls: cannot access '/usr/lib/tmpfiles.d/ovn-tmpfiles.conf': No such file or directory
- root@noble:~/ovn# ls /usr/lib/sysusers.d/ovn-sysusers.conf
- ls: cannot access '/usr/lib/sysusers.d/ovn-sysusers.conf': No such file or directory
- # Verify traditional recursive chown behavior on startup using strace
- test_root=/tmp/ovn-default-chown-test
- rm -rf "$test_root"
- install -d -m 0700 -o nobody -g nogroup "$test_root/log"
- install -d -m 0700 -o root -g root "$test_root/run-ovn"
- install -d -m 0700 -o root -g root "$test_root/run-ovs"
- install -m 0600 -o nobody -g nogroup /dev/null "$test_root/log/ovn-controller.log"
- root@noble:~/ovn# stat -c '%a %U:%G %n' "$test_root/log" "$test_root/log/ovn-controller.log"
- 700 nobody:nogroup /tmp/ovn-default-chown-test/log
- 600 nobody:nogroup /tmp/ovn-default-chown-test/log/ovn-controller.log
- strace -f \
- -e trace=chown,fchownat \
- -o "$test_root/chown.trace" \
- env \
- OVN_LOGDIR="$test_root/log" \
- OVN_RUNDIR="$test_root/run-ovn" \
- OVS_RUNDIR="$test_root/run-ovs" \
- /usr/share/ovn/scripts/ovn-ctl \
- --no-monitor \
- --ovn-user=daemon:daemon \
- start_controller || true
- root@noble:~# test_root=/tmp/ovn-default-chown-test
- stat -c '%a %U:%G %n' "$test_root/log" "$test_root/log/ovn-controller.log"
- 700 daemon:daemon /tmp/ovn-default-chown-test/log
- 600 daemon:daemon /tmp/ovn-default-chown-test/log/ovn-controller.log
Advertisement