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

cmd: add detection for containers and pid1 #248

Closed
wants to merge 2 commits into from

Commits on Jun 28, 2023

  1. cmd: add detection for containers and pid1

    The system manager currently makes some assumptions about the environment
    it is running in.
    
    For example, it assumes that a shutdown program is available in userspace
    and accessible with PATH configured appropriately.
    
    internals/daemon/daemon.go:
    :
    cmd := exec.Command("shutdown", "-r", ...
    :
    
    This patch adds two detection mechanisms that will allow code to make
    environment specific decisions in the future (not part of this patch):
    
    - cmd.IsConfined() returns true if running inside a container runtime
    
    - cmd.IsInit() returns true if the system manager was started as PID 1
    
    In addition, the overlord code currently disables reboot failure detection
    if the system manager is running as PID 1. However, this change is only
    required for container runtimes, and not generically.
    
    - Update the boot id workaround code to only apply for container runtimes.
    flotter committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    5844e79 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9c11f29 View commit details
    Browse the repository at this point in the history