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

generator: Don't reload udev in the generator #304

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Commits on Sep 6, 2023

  1. generator: Don't reload udev in the generator

    The systemd documentation states that any kind of process communication
    shouldn't happen inside generators. It can cause problems like the one
    reported in LP#1999178.
    
    Ubuntu seems to not be affected by the same issue yet, but as the
    problem happens due to a race condition we might run into it in the
    future as well.
    
    This change moves the call to the udevadm command from the generator to
    the Python code. To keep the behaviour as close to the previous one as
    possible, the call is made as part of the generate command.
    
    We could simply check if the generator is being called as a systemd
    generator and don't call udevadm, but in the end the binary still is a
    generator so we shouldn't even have that logic there.
    
    The same is true for the calls we make to systemd using systemctl. Even
    though they are not executed when the binary is called as a generator,
    they probably shouldn't be there.
    daniloegea committed Sep 6, 2023
    Configuration menu
    Copy the full SHA
    a93601f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2ab25b1 View commit details
    Browse the repository at this point in the history
  3. tests: Fix coverage

    daniloegea committed Sep 6, 2023
    Configuration menu
    Copy the full SHA
    b590c96 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3f4259e View commit details
    Browse the repository at this point in the history