diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2024-01-25 16:35:29 +0100 | 
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2024-01-27 19:01:19 +0100 | 
| commit | 444bc5e237ca7d95c61f68e3a4951744058c9b64 (patch) | |
| tree | 5acc910d3c402ac399b6b04111dab09cb8b46624 | |
| parent | ff62df2e4484b9f89fea4ed736006c21f3a797cc (diff) | |
build: update packaging & docs for dir changes
`--sysconfdir` and `--localstatedir` now align with general autoconf
practices.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
25 files changed, 65 insertions, 66 deletions
diff --git a/alpine/APKBUILD.in b/alpine/APKBUILD.in index 9a29ff3a96..98d3e51452 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 4a4a7a0fb5..90ef60ee8b 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 43e5d7e614..0f84145718 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 fb796e491e..3531162360 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 e6da830194..eabf515d2e 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 6d18e7be93..2d514ead1e 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 ca882eedbc..06bc18c252 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 7071cb660d..fe4eeea601 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 1b2f1b933a..a590cf7c74 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 707f1e7033..beefb59a27 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 af0b72b16d..7c8fb83cfa 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 0bc8277930..86506a9dd9 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 3d1fcacf1b..b3fd37aa10 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 30332875a0..9f9073d4e2 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 8958862fea..77c0e008ef 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 e751ba338c..abb04a028b 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 00bc2e5f09..6d7f346231 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 3bf78f7633..af99262c4f 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 b98d237e68..49fd6c854c 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 2259c7e375..7c65164b0e 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 24c6c223e3..efe4787696 100644 --- a/doc/user/installation.rst +++ b/doc/user/installation.rst @@ -394,13 +394,20 @@ options to the configuration script.  .. option:: --sysconfdir <dir> -   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 <dir> -   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 <dir> + +   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 <dir> @@ -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 5cdbdb0f3d..9b9b4061ed 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 c2391206b7..83c881a14b 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 607cbc7fe3..84f3136e06 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 3b296a1497..4a88dc677f 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 \  | 
