Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: fix a pile of directory and/or state retention related issues #15243

Merged
merged 19 commits into from
Jan 28, 2024

Commits on Jan 27, 2024

  1. build: add ax_recursive_eval.m4

    As found in the GNU autoconf archive
    https://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git
    
    Signed-off-by: David Lamparter <[email protected]>
    eqvinox committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    f8eb388 View commit details
    Browse the repository at this point in the history
  2. build: add recursion limit for AX_RECURSIVE_EVAL

    The autoconf version can just loop forever, abort instead.
    
    Signed-off-by: David Lamparter <[email protected]>
    eqvinox committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    b052b18 View commit details
    Browse the repository at this point in the history
  3. build: use AX_RECURSIVE_EVAL

    Replace inline expansion loop.  (Also correctly handles prefix=NONE and
    exec_prefix=NONE inside the macro.)
    
    Signed-off-by: David Lamparter <[email protected]>
    eqvinox committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    27f6171 View commit details
    Browse the repository at this point in the history
  4. build: untangle sysconfdir & localstatedir

    `--sysconfdir` should be `/etc` and `--localstatedir` should be `/var`.
    The package-specific subdirectory should be added by configure, not
    given by the user, to match established behavior by other packages.
    
    Note that `--bindir`, `--sbindir`, `--libdir` and `--libexecdir` have
    different established/expected behavior due to distro specific
    multi-arch support.  That's why these are left unchanged.
    
    The reason this is getting fixed now is that we need to use
    `--localstatedir` for its actual value to put things in `/var/lib`.  As
    it is now, being overloaded for `/run`, the configured `/var` path
    becomes inaccessible.
    
    Signed-off-by: David Lamparter <[email protected]>
    eqvinox committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    ff62df2 View commit details
    Browse the repository at this point in the history
  5. build: update packaging & docs for dir changes

    `--sysconfdir` and `--localstatedir` now align with general autoconf
    practices.
    
    Signed-off-by: David Lamparter <[email protected]>
    eqvinox committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    444bc5e View commit details
    Browse the repository at this point in the history
  6. *: rename frr_vtydir to frr_runstatedir

    Also remove frr_init_vtydir(), just initialize to default.
    
    Signed-off-by: David Lamparter <[email protected]>
    eqvinox committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    42eeea0 View commit details
    Browse the repository at this point in the history
  7. lib, mgmtd: fix wrong mgmtd socket paths

    These paths were ignoring the `-N` namespacing option.
    
    Signed-off-by: David Lamparter <[email protected]>
    eqvinox committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    0d5a249 View commit details
    Browse the repository at this point in the history
  8. build: nuke BFDD_CONTROL_SOCKET

    This just unnecessarily complicates things by involving autoconf.
    
    Signed-off-by: David Lamparter <[email protected]>
    eqvinox committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    80b6787 View commit details
    Browse the repository at this point in the history
  9. build: nuke ZEBRA_SERV_PATH

    This just unnecessarily complicates things by involving autoconf.
    
    Signed-off-by: David Lamparter <[email protected]>
    eqvinox committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    72783ec View commit details
    Browse the repository at this point in the history
  10. build: nuke LDPD_SOCKET

    This just unnecessarily complicates things by involving autoconf.
    
    Signed-off-by: David Lamparter <[email protected]>
    eqvinox committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    0f79e6b View commit details
    Browse the repository at this point in the history
  11. lib: set up frr_libstatedir

    This needs to be used for persistent state, which currently is misplaced
    into `/var/run` / `/run` where it gets deleted across reboots.
    
    Signed-off-by: David Lamparter <[email protected]>
    eqvinox committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    a97d0c5 View commit details
    Browse the repository at this point in the history
  12. lib: create frr_daemon_state_{load,save}

    These functions load daemon-specific persistent state from
    `/var/lib/frr` and supersede open-coded variants of similar calls in
    ospfd, ospf6d and isisd to save GR state and/or sequence numbers.
    
    Unlike the open-coded variants, the save call correctly `fsync()`s the
    saved data to ensure disk contents are consistent.
    
    Signed-off-by: David Lamparter <[email protected]>
    eqvinox committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    cd35ecc View commit details
    Browse the repository at this point in the history
  13. *: fix frr_daemon_info indentation

    clang-format doesn't understand FRR_DAEMON_INFO is a long macro where
    laying out items semantically makes sense.
    
    (Also use only one `FRR_DAEMON_INFO(` in isisd so editors don't get
    confused with the mismatching `( ( )`.
    
    Signed-off-by: David Lamparter <[email protected]>
    eqvinox committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    634f481 View commit details
    Browse the repository at this point in the history
  14. isisd: fix overload state location

    This belongs in `/var/lib`, not `/var/run`.  Also the filename was
    typo'd (`isid-restart.json`).
    
    Change to proper location and fall back to previous in case it's the
    first restart after an FRR update from a version with the bugged path.
    
    Signed-off-by: David Lamparter <[email protected]>
    eqvinox committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    e354c6e View commit details
    Browse the repository at this point in the history
  15. ospfd: fix GR state location

    This belongs in `/var/lib`, not `/var/run`.
    
    Use library facility to load/save, support previous path as fallback,
    and do proper fsync().
    
    Signed-off-by: David Lamparter <[email protected]>
    eqvinox committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    110945b View commit details
    Browse the repository at this point in the history
  16. ospf6d: fix GR & auth seqno state location

    Unfortunately, `ospf6d` is much worse than `ospfd` and `isisd` regarding
    its state saving, due to the existence of the auth trailer code.
    
    Again, this belongs in `/var/lib`, not `/var/run`.
    
    Merge both state files into one, and add reconciliation code for the
    auth seqno.
    
    I'm gonna save my comment on the fact that `ospf6_auth_seqno_nvm_delete`
    is not in fact used anywhere.  Which is now a warning because it's
    `static`.  Well.  It probably should be used somewhere, so leave it in.
    
    Signed-off-by: David Lamparter <[email protected]>
    eqvinox committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    567f570 View commit details
    Browse the repository at this point in the history
  17. lib, mgmtd: fix commit history location

    Both of these belong in `/var/lib`, not `/var/run`.
    
    Rather hilariously, the history read in
    `mgmt_history_read_cmt_record_index` was always failing, because it was
    doing a `file_exists(MGMTD_COMMIT_FILE_PATH)` check.  Which is the wrong
    macro - it's `.../commit-%s.json`, including the unprocessed `%s`, which
    would never exist.
    
    I guess noone ever tried if this actually works.  Cool.
    
    On the plus side, this means I don't have to implement legacy
    compatibility for this, since it never worked to begin with.
    
    (SQLite3 DB location is also changed in this commit since it also uses
    `DAEMON_DB_DIR`.)
    
    Signed-off-by: David Lamparter <[email protected]>
    eqvinox committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    bfd6d8e View commit details
    Browse the repository at this point in the history
  18. babeld: remove bogus config path print

    This doesn't align with what the code actually loads, remove it.
    
    Signed-off-by: David Lamparter <[email protected]>
    eqvinox committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    f1ad2c4 View commit details
    Browse the repository at this point in the history
  19. build: homologize path handling

    Use consistent `e_somepath` names for expanded versions of `somepath`.
    Also remove all paths from `config.h` and put them into
    `lib/config_paths.h` - this is to make more obvious when someone is
    doing something probably not quite properly structured.
    
    Signed-off-by: David Lamparter <[email protected]>
    eqvinox committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    bbd8589 View commit details
    Browse the repository at this point in the history