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

Support systemd socket activation #429

Merged

Commits on Mar 28, 2024

  1. parent: refactor cmd files and environment to helper function

    Before editing this code, it will be helpful to factor it out first.
    
    Signed-off-by: charliemirabile <46761267+charliemirabile@users.noreply.github.com>
    charliemirabile committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    af73bd2 View commit details
    Browse the repository at this point in the history
  2. parent: setupFilesAndEnv: avoid hardcoded file descriptor numbers

    The environment variable contained hardcoded values of 3 and 4 for the file
    descriptors. If more file desciptors will be shared the pipes might no longer
    be file descriptors 3 and 4.
    
    Signed-off-by: charliemirabile <46761267+charliemirabile@users.noreply.github.com>
    charliemirabile committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    72ba15b View commit details
    Browse the repository at this point in the history
  3. parent: setupFilesAndEnv: introduce dynamic array for cmd.ExtraFiles

    since (an unknown amount) more values will be added to cmd.ExtraFiles, making
    a dynamic array and slotting the two values in to specific indices (and then
    referencing those indices in the environment variable) will make things more
    flexible.
    
    Signed-off-by: charliemirabile <46761267+charliemirabile@users.noreply.github.com>
    charliemirabile committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    5600b77 View commit details
    Browse the repository at this point in the history
  4. parent: setupFilesAndEnv: systemd socket activation concept

    introduce a variable to hold a count of files from systemd. this value is always zero for now,
    but will come to hold the count of how many file descriptors we inherited from systemd
    
    Signed-off-by: charliemirabile <46761267+charliemirabile@users.noreply.github.com>
    charliemirabile committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    d1c2e37 View commit details
    Browse the repository at this point in the history
  5. parent: setupFilesAndEnv: retrieve socket count from systemd environm…

    …ent variable
    
    If this environemnt variable is set and the value is an integer n, we should arrange to
    have the child inherit a copy of our file descriptors 3, 4, ... 3 + n.
    
    Signed-off-by: charliemirabile <46761267+charliemirabile@users.noreply.github.com>
    charliemirabile committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    4865ecb View commit details
    Browse the repository at this point in the history
  6. child: createCmd: propogate systemd files to actual process within na…

    …mespace
    
    The child will inheret the file descriptors from the parent, but it needs to
    pass them along to its child, the actual target process within the environment.
    
    Signed-off-by: charliemirabile <46761267+charliemirabile@users.noreply.github.com>
    charliemirabile committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    8c06f0b View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2024

  1. testing: add test for systemd socket activation

    This test is not currently run in CI, but it can be run locally.
    
    Signed-off-by: charliemirabile <46761267+charliemirabile@users.noreply.github.com>
    charliemirabile committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    040875c View commit details
    Browse the repository at this point in the history