From 444bc5e237ca7d95c61f68e3a4951744058c9b64 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 25 Jan 2024 16:35:29 +0100 Subject: [PATCH] build: update packaging & docs for dir changes `--sysconfdir` and `--localstatedir` now align with general autoconf practices. Signed-off-by: David Lamparter --- alpine/APKBUILD.in | 6 ++---- buildtest.sh | 2 +- debian/rules | 2 -- doc/developer/building-frr-for-centos6.rst | 2 -- doc/developer/building-frr-for-centos7.rst | 2 -- doc/developer/building-frr-for-centos8.rst | 2 -- doc/developer/building-frr-for-debian12.rst | 4 ++-- doc/developer/building-frr-for-debian8.rst | 10 +++++----- doc/developer/building-frr-for-debian9.rst | 4 ++-- doc/developer/building-frr-for-freebsd10.rst | 4 ++-- doc/developer/building-frr-for-freebsd11.rst | 4 ++-- doc/developer/building-frr-for-freebsd13.rst | 4 ++-- doc/developer/building-frr-for-freebsd14.rst | 4 ++-- doc/developer/building-frr-for-freebsd9.rst | 4 ++-- doc/developer/building-frr-for-netbsd6.rst | 4 ++-- doc/developer/building-frr-for-netbsd7.rst | 4 ++-- doc/developer/building-frr-for-openbsd6.rst | 4 ++-- doc/developer/cross-compiling.rst | 4 ++-- doc/developer/include-compile.rst | 4 ++-- doc/developer/topotests.rst | 9 +++++---- doc/user/installation.rst | 19 +++++++++++++------ docker/ubuntu-ci/Dockerfile | 4 ++-- redhat/frr.spec.in | 17 +++++++++-------- snapcraft/snapcraft.yaml.in | 4 ++-- tests/topotests/docker/inner/compile_frr.sh | 4 ++-- 25 files changed, 65 insertions(+), 66 deletions(-) diff --git a/alpine/APKBUILD.in b/alpine/APKBUILD.in index 9a29ff3a9636..98d3e51452f4 100644 --- a/alpine/APKBUILD.in +++ b/alpine/APKBUILD.in @@ -28,9 +28,7 @@ source="$pkgname-$pkgver.tar.gz" builddir="$srcdir"/$pkgname-$pkgver _sbindir=/usr/lib/frr -_sysconfdir=/etc/frr _libdir=/usr/lib -_localstatedir=/var/run/frr _user=frr build() { @@ -38,10 +36,10 @@ build() { ./configure \ --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ --sbindir=$_sbindir \ - --sysconfdir=$_sysconfdir \ --libdir=$_libdir \ - --localstatedir=$_localstatedir \ --enable-rpki \ --enable-vtysh \ --enable-multipath=64 \ diff --git a/buildtest.sh b/buildtest.sh index 4a4a7a0fb552..90ef60ee8b30 100755 --- a/buildtest.sh +++ b/buildtest.sh @@ -5,7 +5,7 @@ # builds some git commit of FRR in some different configurations # usage: buildtest.sh [commit [configurations...]] -basecfg="--prefix=/usr --enable-user=frr --enable-group=frr --enable-vty-group=frr --enable-configfile-mask=0660 --enable-logfile-mask=0640 --enable-vtysh --sysconfdir=/etc/frr --localstatedir=/var/run/frr --libdir=/usr/lib64/frr --enable-rtadv --disable-static --enable-isisd --enable-multipath=0 --enable-pimd --enable-werror" +basecfg="--prefix=/usr --enable-user=frr --enable-group=frr --enable-vty-group=frr --enable-configfile-mask=0660 --enable-logfile-mask=0640 --enable-vtysh --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib64/frr --enable-rtadv --disable-static --enable-isisd --enable-multipath=0 --enable-pimd --enable-werror" configs_base="gcc|$basecfg" diff --git a/debian/rules b/debian/rules index 43e5d7e614ad..0f841457180e 100755 --- a/debian/rules +++ b/debian/rules @@ -41,9 +41,7 @@ export PYTHON=python3 override_dh_auto_configure: $(shell dpkg-buildflags --export=sh); \ dh_auto_configure -- \ - --localstatedir=/var/run/frr \ --sbindir=/usr/lib/frr \ - --sysconfdir=/etc/frr \ --with-vtysh-pager=/usr/bin/pager \ --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)/frr \ --with-moduledir=/usr/lib/$(DEB_HOST_MULTIARCH)/frr/modules \ diff --git a/doc/developer/building-frr-for-centos6.rst b/doc/developer/building-frr-for-centos6.rst index fb796e491e81..35311623608f 100644 --- a/doc/developer/building-frr-for-centos6.rst +++ b/doc/developer/building-frr-for-centos6.rst @@ -161,10 +161,8 @@ an example.) ./configure \ --bindir=/usr/bin \ --sbindir=/usr/lib/frr \ - --sysconfdir=/etc/frr \ --libdir=/usr/lib/frr \ --libexecdir=/usr/lib/frr \ - --localstatedir=/var/run/frr \ --with-moduledir=/usr/lib/frr/modules \ --disable-pimd \ --enable-snmp=agentx \ diff --git a/doc/developer/building-frr-for-centos7.rst b/doc/developer/building-frr-for-centos7.rst index e6da83019405..eabf515d2e77 100644 --- a/doc/developer/building-frr-for-centos7.rst +++ b/doc/developer/building-frr-for-centos7.rst @@ -58,10 +58,8 @@ an example.) ./configure \ --bindir=/usr/bin \ --sbindir=/usr/lib/frr \ - --sysconfdir=/etc/frr \ --libdir=/usr/lib/frr \ --libexecdir=/usr/lib/frr \ - --localstatedir=/var/run/frr \ --with-moduledir=/usr/lib/frr/modules \ --enable-snmp=agentx \ --enable-multipath=64 \ diff --git a/doc/developer/building-frr-for-centos8.rst b/doc/developer/building-frr-for-centos8.rst index 6d18e7be93a3..2d514ead1e24 100644 --- a/doc/developer/building-frr-for-centos8.rst +++ b/doc/developer/building-frr-for-centos8.rst @@ -52,10 +52,8 @@ an example.) ./configure \ --bindir=/usr/bin \ --sbindir=/usr/lib/frr \ - --sysconfdir=/etc/frr \ --libdir=/usr/lib/frr \ --libexecdir=/usr/lib/frr \ - --localstatedir=/var/run/frr \ --with-moduledir=/usr/lib/frr/modules \ --enable-snmp=agentx \ --enable-multipath=64 \ diff --git a/doc/developer/building-frr-for-debian12.rst b/doc/developer/building-frr-for-debian12.rst index ca882eedbcd8..06bc18c25262 100644 --- a/doc/developer/building-frr-for-debian12.rst +++ b/doc/developer/building-frr-for-debian12.rst @@ -47,9 +47,9 @@ an example.) cd frr ./bootstrap.sh ./configure \ - --localstatedir=/var/opt/frr \ + --sysconfdir=/etc \ + --localstatedir=/var \ --sbindir=/usr/lib/frr \ - --sysconfdir=/etc/frr \ --enable-multipath=64 \ --enable-user=frr \ --enable-group=frr \ diff --git a/doc/developer/building-frr-for-debian8.rst b/doc/developer/building-frr-for-debian8.rst index 7071cb660de8..fe4eeea601d0 100644 --- a/doc/developer/building-frr-for-debian8.rst +++ b/doc/developer/building-frr-for-debian8.rst @@ -57,9 +57,9 @@ an example.) cd frr ./bootstrap.sh ./configure \ - --localstatedir=/var/run/frr \ + --sysconfdir=/etc \ + --localstatedir=/var \ --sbindir=/usr/lib/frr \ - --sysconfdir=/etc/frr \ --enable-multipath=64 \ --enable-user=frr \ --enable-group=frr \ @@ -118,9 +118,9 @@ Troubleshooting The local state directory must exist and have the correct permissions applied for the frrouting daemons to start. In the above ./configure -example the local state directory is set to /var/run/frr -(--localstatedir=/var/run/frr) Debian considers /var/run/frr to be -temporary and this is removed after a reboot. +example the local state directory is set to ``/var`` such that ``/var/run/frr`` +is used. Debian considers ``/var/run/frr`` to be temporary and this is removed +after a reboot. When using a different local state directory you need to create the new directory and change the ownership to the frr user, for example: diff --git a/doc/developer/building-frr-for-debian9.rst b/doc/developer/building-frr-for-debian9.rst index 1b2f1b933a42..a590cf7c7483 100644 --- a/doc/developer/building-frr-for-debian9.rst +++ b/doc/developer/building-frr-for-debian9.rst @@ -47,9 +47,9 @@ an example.) cd frr ./bootstrap.sh ./configure \ - --localstatedir=/var/opt/frr \ + --sysconfdir=/etc \ + --localstatedir=/var \ --sbindir=/usr/lib/frr \ - --sysconfdir=/etc/frr \ --enable-multipath=64 \ --enable-user=frr \ --enable-group=frr \ diff --git a/doc/developer/building-frr-for-freebsd10.rst b/doc/developer/building-frr-for-freebsd10.rst index 707f1e703364..beefb59a2775 100644 --- a/doc/developer/building-frr-for-freebsd10.rst +++ b/doc/developer/building-frr-for-freebsd10.rst @@ -60,9 +60,9 @@ an example) export LDFLAGS="-L/usr/local/lib" export CPPFLAGS="-I/usr/local/include" ./configure \ - --sysconfdir=/usr/local/etc/frr \ + --sysconfdir=/usr/local/etc \ + --localstatedir=/var \ --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \ - --localstatedir=/var/run/frr \ --prefix=/usr/local \ --enable-multipath=64 \ --enable-user=frr \ diff --git a/doc/developer/building-frr-for-freebsd11.rst b/doc/developer/building-frr-for-freebsd11.rst index af0b72b16def..7c8fb83cfa25 100644 --- a/doc/developer/building-frr-for-freebsd11.rst +++ b/doc/developer/building-frr-for-freebsd11.rst @@ -65,9 +65,9 @@ an example) setenv CPPFLAGS -I/usr/local/include ln -s /usr/local/bin/sphinx-build-3.6 /usr/local/bin/sphinx-build ./configure \ - --sysconfdir=/usr/local/etc/frr \ + --sysconfdir=/usr/local/etc \ + --localstatedir=/var \ --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \ - --localstatedir=/var/run/frr \ --prefix=/usr/local \ --enable-multipath=64 \ --enable-user=frr \ diff --git a/doc/developer/building-frr-for-freebsd13.rst b/doc/developer/building-frr-for-freebsd13.rst index 0bc827793053..86506a9dd929 100644 --- a/doc/developer/building-frr-for-freebsd13.rst +++ b/doc/developer/building-frr-for-freebsd13.rst @@ -52,9 +52,9 @@ an example) ./bootstrap.sh export MAKE=gmake LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include ./configure \ - --sysconfdir=/usr/local/etc/frr \ + --sysconfdir=/usr/local/etc \ + --localstatedir=/var \ --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \ - --localstatedir=/var/run/frr \ --prefix=/usr/local \ --enable-multipath=64 \ --enable-user=frr \ diff --git a/doc/developer/building-frr-for-freebsd14.rst b/doc/developer/building-frr-for-freebsd14.rst index 3d1fcacf1be5..b3fd37aa102f 100644 --- a/doc/developer/building-frr-for-freebsd14.rst +++ b/doc/developer/building-frr-for-freebsd14.rst @@ -52,9 +52,9 @@ an example) ./bootstrap.sh export MAKE=gmake LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include ./configure \ - --sysconfdir=/usr/local/etc/frr \ + --sysconfdir=/usr/local/etc \ + --localstatedir=/var \ --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \ - --localstatedir=/var/run/frr \ --prefix=/usr/local \ --enable-multipath=64 \ --enable-user=frr \ diff --git a/doc/developer/building-frr-for-freebsd9.rst b/doc/developer/building-frr-for-freebsd9.rst index 30332875a016..9f9073d4e2d0 100644 --- a/doc/developer/building-frr-for-freebsd9.rst +++ b/doc/developer/building-frr-for-freebsd9.rst @@ -70,9 +70,9 @@ an example) export LDFLAGS="-L/usr/local/lib" export CPPFLAGS="-I/usr/local/include" ./configure \ - --sysconfdir=/usr/local/etc/frr \ + --sysconfdir=/usr/local/etc \ + --localstatedir=/var \ --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \ - --localstatedir=/var/run/frr \ --prefix=/usr/local \ --enable-multipath=64 \ --enable-user=frr \ diff --git a/doc/developer/building-frr-for-netbsd6.rst b/doc/developer/building-frr-for-netbsd6.rst index 8958862fea7e..77c0e008ef00 100644 --- a/doc/developer/building-frr-for-netbsd6.rst +++ b/doc/developer/building-frr-for-netbsd6.rst @@ -64,9 +64,9 @@ an example) export LDFLAGS="-L/usr/pkg/lib -R/usr/pkg/lib" export CPPFLAGS="-I/usr/pkg/include" ./configure \ - --sysconfdir=/usr/pkg/etc/frr \ + --sysconfdir=/usr/pkg/etc \ + --localstatedir=/var \ --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \ - --localstatedir=/var/run/frr \ --enable-multipath=64 \ --enable-user=frr \ --enable-group=frr \ diff --git a/doc/developer/building-frr-for-netbsd7.rst b/doc/developer/building-frr-for-netbsd7.rst index e751ba338c11..abb04a028b27 100644 --- a/doc/developer/building-frr-for-netbsd7.rst +++ b/doc/developer/building-frr-for-netbsd7.rst @@ -55,9 +55,9 @@ an example) export LDFLAGS="-L/usr/pkg/lib -R/usr/pkg/lib" export CPPFLAGS="-I/usr/pkg/include" ./configure \ - --sysconfdir=/usr/pkg/etc/frr \ + --sysconfdir=/usr/pkg/etc \ + --localstatedir=/var \ --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \ - --localstatedir=/var/run/frr \ --enable-multipath=64 \ --enable-user=frr \ --enable-group=frr \ diff --git a/doc/developer/building-frr-for-openbsd6.rst b/doc/developer/building-frr-for-openbsd6.rst index 00bc2e5f091d..6d7f34623167 100644 --- a/doc/developer/building-frr-for-openbsd6.rst +++ b/doc/developer/building-frr-for-openbsd6.rst @@ -71,8 +71,8 @@ an example) export LDFLAGS="-L/usr/local/lib" export CPPFLAGS="-I/usr/local/include" ./configure \ - --sysconfdir=/etc/frr \ - --localstatedir=/var/frr \ + --sysconfdir=/etc \ + --localstatedir=/var \ --enable-multipath=64 \ --enable-user=_frr \ --enable-group=_frr \ diff --git a/doc/developer/cross-compiling.rst b/doc/developer/cross-compiling.rst index 3bf78f7633fc..af99262c4f0e 100644 --- a/doc/developer/cross-compiling.rst +++ b/doc/developer/cross-compiling.rst @@ -239,9 +239,9 @@ the last thing to actually build is FRR itself: --host=${HOST_ARCH} \ --with-sysroot=/usr/${HOST_ARCH} \ --with-clippy=./build-clippy/lib/clippy \ - --sysconfdir=/etc/frr \ + --sysconfdir=/etc \ + --localstatedir=/var \ --sbindir="\${prefix}/lib/frr" \ - --localstatedir=/var/run/frr \ --prefix=/usr \ --enable-user=frr \ --enable-group=frr \ diff --git a/doc/developer/include-compile.rst b/doc/developer/include-compile.rst index b98d237e68a8..49fd6c854cb6 100644 --- a/doc/developer/include-compile.rst +++ b/doc/developer/include-compile.rst @@ -14,8 +14,8 @@ obtained by running ``./configure -h``. The options shown below are examples. --sbindir=\${prefix}/lib/frr \ --libdir=\${prefix}/lib/frr \ --libexecdir=\${prefix}/lib/frr \ - --localstatedir=/var/run/frr \ - --sysconfdir=/etc/frr \ + --sysconfdir=/etc \ + --localstatedir=/var \ --with-moduledir=\${prefix}/lib/frr/modules \ --enable-configfile-mask=0640 \ --enable-logfile-mask=0640 \ diff --git a/doc/developer/topotests.rst b/doc/developer/topotests.rst index 2259c7e375f5..7c65164b0e05 100644 --- a/doc/developer/topotests.rst +++ b/doc/developer/topotests.rst @@ -113,9 +113,9 @@ If you prefer to manually build FRR, then use the following suggested config: ./configure \ --prefix=/usr \ - --localstatedir=/var/run/frr \ + --sysconfdir=/etc \ + --localstatedir=/var \ --sbindir=/usr/lib/frr \ - --sysconfdir=/etc/frr \ --enable-vtysh \ --enable-pimd \ --enable-pim6d \ @@ -383,8 +383,9 @@ for ``master`` branch: ./bootstrap.sh ./configure \ --enable-address-sanitizer \ - --prefix=/usr/lib/frr --sysconfdir=/etc/frr \ - --localstatedir=/var/run/frr \ + --prefix=/usr/lib/frr \ + --sysconfdir=/etc \ + --localstatedir=/var \ --sbindir=/usr/lib/frr --bindir=/usr/lib/frr \ --with-moduledir=/usr/lib/frr/modules \ --enable-multipath=0 --enable-rtadv \ diff --git a/doc/user/installation.rst b/doc/user/installation.rst index 24c6c223e3e1..efe478769663 100644 --- a/doc/user/installation.rst +++ b/doc/user/installation.rst @@ -394,13 +394,20 @@ options to the configuration script. .. option:: --sysconfdir - Look for configuration files in `dir` [`prefix`/etc]. Note that sample - configuration files will be installed here. + Look for configuration files in `dir`/frr [`prefix`/etc]. Note that sample + configuration files will be installed here. Should be ``/etc`` unless + your platform splits package configuration locations. .. option:: --localstatedir - Configure zebra to use `dir` for local state files, such as pid files and - unix sockets. + Configure base directory for local state. Indirectly controls + ``--runstatedir``. Should be ``/var`` in most cases. + +.. option:: --runstatedir + + Configure FRR to use `dir`/frr for local state files, such as pid files and + unix sockets. Should be ``/var/run`` (default through ``--localstatedir``) + or ``/run`` in most cases. .. option:: --with-scriptdir @@ -579,9 +586,9 @@ the options you chose: ./configure \ --prefix=/usr \ - --localstatedir=/var/run/frr \ + --sysconfdir=/etc \ + --localstatedir=/var \ --sbindir=/usr/lib/frr \ - --sysconfdir=/etc/frr \ --enable-pimd \ --enable-watchfrr \ ... diff --git a/docker/ubuntu-ci/Dockerfile b/docker/ubuntu-ci/Dockerfile index 5cdbdb0f3dc0..9b9b4061eda3 100644 --- a/docker/ubuntu-ci/Dockerfile +++ b/docker/ubuntu-ci/Dockerfile @@ -110,9 +110,9 @@ RUN cd ~/frr && \ ./bootstrap.sh && \ ./configure \ --prefix=/usr \ - --localstatedir=/var/run/frr \ + --sysconfdir=/etc \ + --localstatedir=/var \ --sbindir=/usr/lib/frr \ - --sysconfdir=/etc/frr \ --enable-sharpd \ --enable-multipath=64 \ --enable-user=frr \ diff --git a/redhat/frr.spec.in b/redhat/frr.spec.in index c2391206b7cc..83c881a14b66 100644 --- a/redhat/frr.spec.in +++ b/redhat/frr.spec.in @@ -42,8 +42,9 @@ %define zeb_docs %{zeb_src}/doc %define frr_tools %{zeb_src}/tools -# defines for configure -%define rundir %{_localstatedir}/run/%{name} +%if 0%{!?_runstatedir:1} +%define _runstatedir %{_localstatedir}/run +%endif ############################################################################ @@ -317,8 +318,8 @@ routing state through standard SNMP MIBs. %configure \ --sbindir=%{_sbindir} \ - --sysconfdir=%{configdir} \ - --localstatedir=%{rundir} \ + --sysconfdir=%{_sysconfdir} \ + --localstatedir=%{_localstatedir} \ --disable-static \ --disable-werror \ --enable-irdp \ @@ -471,7 +472,7 @@ install %{zeb_src}/tools/etc/frr/daemons %{buildroot}%{_sysconfdir}/frr install %{zeb_src}/tools/etc/frr/frr.conf %{buildroot}%{_sysconfdir}/frr/frr.conf.template install -m644 %{zeb_rh_src}/frr.pam %{buildroot}%{_sysconfdir}/pam.d/frr install -m644 %{zeb_src}/tools/etc/logrotate.d/frr %{buildroot}%{_sysconfdir}/logrotate.d/frr -install -d -m750 %{buildroot}%{rundir} +install -d -m750 %{buildroot}%{_runstatedir}/frr %if 0%{?rhel} > 7 || 0%{?fedora} > 29 # avoid `ERROR: ambiguous python shebang in` errors @@ -495,7 +496,7 @@ rm -f %{buildroot}%{_sbindir}/ospfclient.py getent passwd %{frr_user} >/dev/null || \ useradd -r -u %{frr_uid} -g %{frr_user} \ -s /sbin/nologin -c "FRRouting suite" \ - -d %{rundir} %{frr_user} + -d %{_runstatedir}/frr %{frr_user} %if 0%{?vty_group:1} usermod -a -G %{vty_group} %{frr_user} @@ -655,11 +656,11 @@ fi %if 0%{?frr_user:1} %dir %attr(751,%{frr_user},%{frr_user}) %{configdir} %dir %attr(755,%{frr_user},%{frr_user}) %{_localstatedir}/log/frr - %dir %attr(751,%{frr_user},%{frr_user}) %{rundir} + %dir %attr(751,%{frr_user},%{frr_user}) %{_runstatedir}/frr %else %dir %attr(750,root,root) %{configdir} %dir %attr(755,root,root) %{_localstatedir}/log/frr - %dir %attr(750,root,root) %{rundir} + %dir %attr(750,root,root) %{_runstatedir}/frr %endif %{_infodir}/frr.info.gz %{_mandir}/man*/* diff --git a/snapcraft/snapcraft.yaml.in b/snapcraft/snapcraft.yaml.in index 607cbc7fe3c2..84f3136e06bb 100644 --- a/snapcraft/snapcraft.yaml.in +++ b/snapcraft/snapcraft.yaml.in @@ -381,10 +381,10 @@ parts: - --enable-vrrpd - --enable-configfile-mask=0640 - --enable-logfile-mask=0640 - - --localstatedir=/var/run + - --sysconfdir=/etc + - --localstatedir=/var - --sbindir=/sbin - --bindir=/bin - - --sysconfdir=/etc/frr - --with-pkg-extra-version=@PACKAGE_EXTRAVERSION@ frr-defaults: plugin: dump diff --git a/tests/topotests/docker/inner/compile_frr.sh b/tests/topotests/docker/inner/compile_frr.sh index 3b296a149758..4a88dc677f3c 100755 --- a/tests/topotests/docker/inner/compile_frr.sh +++ b/tests/topotests/docker/inner/compile_frr.sh @@ -64,9 +64,9 @@ if [ ! -e Makefile ]; then --enable-dev-build \ --with-moduledir=/usr/lib/frr/modules \ --prefix=/usr \ - --localstatedir=/var/run/frr \ + --sysconfdir=/etc \ + --localstatedir=/var \ --sbindir=/usr/lib/frr \ - --sysconfdir=/etc/frr \ --enable-multipath=0 \ --enable-fpm \ --enable-sharpd \