Skip to content

refactor network configuration #12

@jktjkt

Description

@jktjkt

On a bidi amp, the current version (especially when combined with our *.network files in the overlay and our lack of network configuration in the factory-default DS) tries to bring down the osc interface at boot. This interface does not exist, which means that the networkctl down osc fails, which restarts the velia-system.service. By that time, the file in /run has been already deleted, so the second start usually succeeds (unless it's locked-out sysrepo completely, which we've also seen).

The logic which drives this process is currently roughly like this:

  • don't configure network directlky, use systemd-networkd for this
  • have some safe defaults in /usr (except that these are read-only and shared across all system versions, and these have varying interface names)
  • try to keep the network connectivity in case of failures and oops moments
  • try to pre-generate config files as much as possible, store them into /cfg and copy them around at boot time, so that we don't have to flap interfaces up/down needlessly

This sounds OK, but then the module_change_cb only looks at the current config data, then it tries to report back about interfaces which were brought up/down, and finally in the running DS, we shut these interfaces down. I might be wrong, but it looks like this code cannot possibly react to interfaces whose configuration was, e.g., totally removed from the system.

I think that it will be much, much easier to flip the logic around:

  • keep safe defaults in /usr (so that we still boot when this thing doesn't even start or makes a boo-boo)
  • keep pregenerating stuff and copying around via /cfg
  • when generating files, always produce config for all interfaces:
    • if it's disabled, or if the config is not present below /ietf-interfaces:interfaces, just do a zero-byte mask .network file (which overrides whatever default was in /usr).
  • this means that there will always be "new config file" for any given interface (and hopefully there will also be the old one)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions