From 4d3dfdf466f815db966839af43067b630caf3b11 Mon Sep 17 00:00:00 2001 From: Tom Wieczorek Date: Tue, 22 Oct 2024 09:27:12 +0200 Subject: [PATCH 1/8] Refactor command line parsing into its own func Signed-off-by: Tom Wieczorek --- pkg/supervisor/supervisor_unix.go | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/pkg/supervisor/supervisor_unix.go b/pkg/supervisor/supervisor_unix.go index 9a38178c3a4e..b448e4a08836 100644 --- a/pkg/supervisor/supervisor_unix.go +++ b/pkg/supervisor/supervisor_unix.go @@ -107,16 +107,13 @@ func (s *Supervisor) maybeKillPidFile() error { } func (s *Supervisor) shouldKillProcess(pid int) (bool, error) { - cmdline, err := os.ReadFile(filepath.Join("/proc", strconv.Itoa(pid), "cmdline")) - if os.IsNotExist(err) { - return false, nil - } else if err != nil { - return false, fmt.Errorf("failed to read process cmdline: %w", err) - } - // only kill process if it has the expected cmd - cmd := strings.Split(string(cmdline), "\x00") - if cmd[0] != s.BinPath { + if cmd, err := cmdline(pid); err != nil { + if errors.Is(err, syscall.ESRCH) { + return false, nil + } + return false, err + } else if len(cmd) > 0 && cmd[0] != s.BinPath { return false, nil } @@ -135,3 +132,15 @@ func (s *Supervisor) shouldKillProcess(pid int) (bool, error) { } return false, nil } + +func cmdline(pid int) ([]string, error) { + cmdline, err := os.ReadFile(filepath.Join("/proc", strconv.Itoa(pid), "cmdline")) + if err != nil { + if errors.Is(err, os.ErrNotExist) { + return nil, fmt.Errorf("%w: %w", syscall.ESRCH, err) + } + return nil, fmt.Errorf("failed to read process cmdline: %w", err) + } + + return strings.Split(string(cmdline), "\x00"), nil +} From 36c37d78636e00228b52a4d0e89213fd85883474 Mon Sep 17 00:00:00 2001 From: Tom Wieczorek Date: Tue, 22 Oct 2024 09:31:49 +0200 Subject: [PATCH 2/8] Refactor process environment parsing into its own func Signed-off-by: Tom Wieczorek --- pkg/supervisor/supervisor_unix.go | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/pkg/supervisor/supervisor_unix.go b/pkg/supervisor/supervisor_unix.go index b448e4a08836..965c5fb70ebe 100644 --- a/pkg/supervisor/supervisor_unix.go +++ b/pkg/supervisor/supervisor_unix.go @@ -23,6 +23,7 @@ import ( "fmt" "os" "path/filepath" + "slices" "strconv" "strings" "syscall" @@ -118,19 +119,16 @@ func (s *Supervisor) shouldKillProcess(pid int) (bool, error) { } //only kill process if it has the _KOS_MANAGED env set - env, err := os.ReadFile(filepath.Join("/proc", strconv.Itoa(pid), "environ")) - if os.IsNotExist(err) { + if env, err := environ(pid); err != nil { + if errors.Is(err, syscall.ESRCH) { + return false, nil + } + return false, err + } else if !slices.Contains(env, k0sManaged) { return false, nil - } else if err != nil { - return false, fmt.Errorf("failed to read process environ: %w", err) } - for _, e := range strings.Split(string(env), "\x00") { - if e == k0sManaged { - return true, nil - } - } - return false, nil + return true, nil } func cmdline(pid int) ([]string, error) { @@ -144,3 +142,15 @@ func cmdline(pid int) ([]string, error) { return strings.Split(string(cmdline), "\x00"), nil } + +func environ(pid int) ([]string, error) { + env, err := os.ReadFile(filepath.Join("/proc", strconv.Itoa(pid), "environ")) + if err != nil { + if errors.Is(err, os.ErrNotExist) { + return nil, fmt.Errorf("%w: %w", syscall.ESRCH, err) + } + return nil, fmt.Errorf("failed to read process environ: %w", err) + } + + return strings.Split(string(env), "\x00"), nil +} From 19a22f4c408094fa9beb0e52e3b9f644012329b0 Mon Sep 17 00:00:00 2001 From: Tom Wieczorek Date: Tue, 22 Oct 2024 09:42:16 +0200 Subject: [PATCH 3/8] Introduce unixPID type Add the cmdline and environ functions to it. Signed-off-by: Tom Wieczorek --- pkg/supervisor/supervisor_unix.go | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/pkg/supervisor/supervisor_unix.go b/pkg/supervisor/supervisor_unix.go index 965c5fb70ebe..e9a41cdc5b2c 100644 --- a/pkg/supervisor/supervisor_unix.go +++ b/pkg/supervisor/supervisor_unix.go @@ -34,9 +34,11 @@ const ( exitCheckInterval = 200 * time.Millisecond ) +type unixPID int + // killPid signals SIGTERM to a PID and if it's still running after // s.TimeoutStop sends SIGKILL. -func (s *Supervisor) killPid(pid int) error { +func (s *Supervisor) killPid(pid unixPID) error { // Kill the process pid deadlineTicker := time.NewTicker(s.TimeoutStop) defer deadlineTicker.Stop() @@ -55,7 +57,7 @@ Loop: return nil } - err = syscall.Kill(pid, syscall.SIGTERM) + err = syscall.Kill(int(pid), syscall.SIGTERM) if errors.Is(err, syscall.ESRCH) { return nil } else if err != nil { @@ -74,7 +76,7 @@ Loop: return nil } - err = syscall.Kill(pid, syscall.SIGKILL) + err = syscall.Kill(int(pid), syscall.SIGKILL) if errors.Is(err, syscall.ESRCH) { return nil } else if err != nil { @@ -100,16 +102,16 @@ func (s *Supervisor) maybeKillPidFile() error { return fmt.Errorf("failed to parse pid file %s: %w", s.PidFile, err) } - if err := s.killPid(p); err != nil { + if err := s.killPid(unixPID(p)); err != nil { return fmt.Errorf("failed to kill process with PID %d: %w", p, err) } return nil } -func (s *Supervisor) shouldKillProcess(pid int) (bool, error) { +func (s *Supervisor) shouldKillProcess(pid unixPID) (bool, error) { // only kill process if it has the expected cmd - if cmd, err := cmdline(pid); err != nil { + if cmd, err := pid.cmdline(); err != nil { if errors.Is(err, syscall.ESRCH) { return false, nil } @@ -119,7 +121,7 @@ func (s *Supervisor) shouldKillProcess(pid int) (bool, error) { } //only kill process if it has the _KOS_MANAGED env set - if env, err := environ(pid); err != nil { + if env, err := pid.environ(); err != nil { if errors.Is(err, syscall.ESRCH) { return false, nil } @@ -131,8 +133,8 @@ func (s *Supervisor) shouldKillProcess(pid int) (bool, error) { return true, nil } -func cmdline(pid int) ([]string, error) { - cmdline, err := os.ReadFile(filepath.Join("/proc", strconv.Itoa(pid), "cmdline")) +func (pid unixPID) cmdline() ([]string, error) { + cmdline, err := os.ReadFile(filepath.Join("/proc", strconv.Itoa(int(pid)), "cmdline")) if err != nil { if errors.Is(err, os.ErrNotExist) { return nil, fmt.Errorf("%w: %w", syscall.ESRCH, err) @@ -143,8 +145,8 @@ func cmdline(pid int) ([]string, error) { return strings.Split(string(cmdline), "\x00"), nil } -func environ(pid int) ([]string, error) { - env, err := os.ReadFile(filepath.Join("/proc", strconv.Itoa(pid), "environ")) +func (pid unixPID) environ() ([]string, error) { + env, err := os.ReadFile(filepath.Join("/proc", strconv.Itoa(int(pid)), "environ")) if err != nil { if errors.Is(err, os.ErrNotExist) { return nil, fmt.Errorf("%w: %w", syscall.ESRCH, err) From 22f21701a8f97a6f77bb82d089d2b91b98f6ae9c Mon Sep 17 00:00:00 2001 From: Tom Wieczorek Date: Tue, 22 Oct 2024 09:48:13 +0200 Subject: [PATCH 4/8] Add termination methods to unixPID This encapsulates the kill syscall. Signed-off-by: Tom Wieczorek --- pkg/supervisor/supervisor_unix.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkg/supervisor/supervisor_unix.go b/pkg/supervisor/supervisor_unix.go index e9a41cdc5b2c..dc53e22b485f 100644 --- a/pkg/supervisor/supervisor_unix.go +++ b/pkg/supervisor/supervisor_unix.go @@ -57,11 +57,11 @@ Loop: return nil } - err = syscall.Kill(int(pid), syscall.SIGTERM) + err = pid.terminateGracefully() if errors.Is(err, syscall.ESRCH) { return nil } else if err != nil { - return fmt.Errorf("failed to send SIGTERM: %w", err) + return fmt.Errorf("failed to terminate gracefully: %w", err) } case <-deadlineTicker.C: break Loop @@ -76,11 +76,11 @@ Loop: return nil } - err = syscall.Kill(int(pid), syscall.SIGKILL) + err = pid.terminateForcibly() if errors.Is(err, syscall.ESRCH) { return nil } else if err != nil { - return fmt.Errorf("failed to send SIGKILL: %w", err) + return fmt.Errorf("failed to terminate forcibly: %w", err) } return nil } @@ -156,3 +156,11 @@ func (pid unixPID) environ() ([]string, error) { return strings.Split(string(env), "\x00"), nil } + +func (pid unixPID) terminateGracefully() error { + return syscall.Kill(int(pid), syscall.SIGTERM) +} + +func (pid unixPID) terminateForcibly() error { + return syscall.Kill(int(pid), syscall.SIGKILL) +} From a71d6ae82f3a597f3ec810a73fcb2e18a3ace7bc Mon Sep 17 00:00:00 2001 From: Tom Wieczorek Date: Tue, 22 Oct 2024 09:51:45 +0200 Subject: [PATCH 5/8] Introduce procHandle interface This encapsulates all of the OS-specific code for interacting with processes identified by PID files. Signed-off-by: Tom Wieczorek --- pkg/supervisor/prochandle.go | 33 +++++++++++++++++++++++++++++++ pkg/supervisor/supervisor_unix.go | 22 ++++++++++----------- 2 files changed, 44 insertions(+), 11 deletions(-) create mode 100644 pkg/supervisor/prochandle.go diff --git a/pkg/supervisor/prochandle.go b/pkg/supervisor/prochandle.go new file mode 100644 index 000000000000..04b3f93e70d3 --- /dev/null +++ b/pkg/supervisor/prochandle.go @@ -0,0 +1,33 @@ +/* +Copyright 2024 k0s authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package supervisor + +// A handle to a running process. May be used to inspect the process properties +// and terminate it. +type procHandle interface { + // Reads and returns the process's command line. + cmdline() ([]string, error) + + // Reads and returns the process's environment. + environ() ([]string, error) + + // Terminates the process gracefully. + terminateGracefully() error + + // Terminates the process forcibly. + terminateForcibly() error +} diff --git a/pkg/supervisor/supervisor_unix.go b/pkg/supervisor/supervisor_unix.go index dc53e22b485f..13e351f42a67 100644 --- a/pkg/supervisor/supervisor_unix.go +++ b/pkg/supervisor/supervisor_unix.go @@ -36,9 +36,9 @@ const ( type unixPID int -// killPid signals SIGTERM to a PID and if it's still running after -// s.TimeoutStop sends SIGKILL. -func (s *Supervisor) killPid(pid unixPID) error { +// Tries to terminate a process gracefully. If it's still running after +// s.TimeoutStop, the process is forcibly terminated. +func (s *Supervisor) killProcess(ph procHandle) error { // Kill the process pid deadlineTicker := time.NewTicker(s.TimeoutStop) defer deadlineTicker.Stop() @@ -49,7 +49,7 @@ Loop: for { select { case <-checkTicker.C: - shouldKill, err := s.shouldKillProcess(pid) + shouldKill, err := s.shouldKillProcess(ph) if err != nil { return err } @@ -57,7 +57,7 @@ Loop: return nil } - err = pid.terminateGracefully() + err = ph.terminateGracefully() if errors.Is(err, syscall.ESRCH) { return nil } else if err != nil { @@ -68,7 +68,7 @@ Loop: } } - shouldKill, err := s.shouldKillProcess(pid) + shouldKill, err := s.shouldKillProcess(ph) if err != nil { return err } @@ -76,7 +76,7 @@ Loop: return nil } - err = pid.terminateForcibly() + err = ph.terminateForcibly() if errors.Is(err, syscall.ESRCH) { return nil } else if err != nil { @@ -102,16 +102,16 @@ func (s *Supervisor) maybeKillPidFile() error { return fmt.Errorf("failed to parse pid file %s: %w", s.PidFile, err) } - if err := s.killPid(unixPID(p)); err != nil { + if err := s.killProcess(unixPID(p)); err != nil { return fmt.Errorf("failed to kill process with PID %d: %w", p, err) } return nil } -func (s *Supervisor) shouldKillProcess(pid unixPID) (bool, error) { +func (s *Supervisor) shouldKillProcess(ph procHandle) (bool, error) { // only kill process if it has the expected cmd - if cmd, err := pid.cmdline(); err != nil { + if cmd, err := ph.cmdline(); err != nil { if errors.Is(err, syscall.ESRCH) { return false, nil } @@ -121,7 +121,7 @@ func (s *Supervisor) shouldKillProcess(pid unixPID) (bool, error) { } //only kill process if it has the _KOS_MANAGED env set - if env, err := pid.environ(); err != nil { + if env, err := ph.environ(); err != nil { if errors.Is(err, syscall.ESRCH) { return false, nil } From 5abf54d21f9fdfac865d4676b886b78a43441a38 Mon Sep 17 00:00:00 2001 From: Tom Wieczorek Date: Tue, 22 Oct 2024 10:03:12 +0200 Subject: [PATCH 6/8] Add newProcHandle function This will be the new factory function for OS-specific process interaction. Signed-off-by: Tom Wieczorek --- pkg/supervisor/supervisor_unix.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/supervisor/supervisor_unix.go b/pkg/supervisor/supervisor_unix.go index 13e351f42a67..ae09e0bb3179 100644 --- a/pkg/supervisor/supervisor_unix.go +++ b/pkg/supervisor/supervisor_unix.go @@ -36,6 +36,10 @@ const ( type unixPID int +func newProcHandle(pid int) (procHandle, error) { + return unixPID(pid), nil +} + // Tries to terminate a process gracefully. If it's still running after // s.TimeoutStop, the process is forcibly terminated. func (s *Supervisor) killProcess(ph procHandle) error { @@ -102,7 +106,12 @@ func (s *Supervisor) maybeKillPidFile() error { return fmt.Errorf("failed to parse pid file %s: %w", s.PidFile, err) } - if err := s.killProcess(unixPID(p)); err != nil { + ph, err := newProcHandle(p) + if err != nil { + return err + } + + if err := s.killProcess(ph); err != nil { return fmt.Errorf("failed to kill process with PID %d: %w", p, err) } From de6909ca57610df76019543921f4597247d3f3f4 Mon Sep 17 00:00:00 2001 From: Tom Wieczorek Date: Tue, 22 Oct 2024 10:23:26 +0200 Subject: [PATCH 7/8] Relocate OS-agnostic Supervisor methods Move the now OS-agnostic Supervisor methods maybeKillPidFile, shouldKillProcess and killPid from the UNIX-specific file into the general one. Signed-off-by: Tom Wieczorek --- pkg/supervisor/supervisor.go | 112 ++++++++++++++++++++++++++- pkg/supervisor/supervisor_unix.go | 108 -------------------------- pkg/supervisor/supervisor_windows.go | 13 ++-- 3 files changed, 118 insertions(+), 115 deletions(-) diff --git a/pkg/supervisor/supervisor.go b/pkg/supervisor/supervisor.go index 6c6ab1cf7df3..bcf4bc85f954 100644 --- a/pkg/supervisor/supervisor.go +++ b/pkg/supervisor/supervisor.go @@ -18,11 +18,13 @@ package supervisor import ( "context" + "errors" "fmt" "os" "os/exec" "path" "runtime" + "slices" "sort" "strconv" "strings" @@ -140,7 +142,11 @@ func (s *Supervisor) Supervise() error { } if err := s.maybeKillPidFile(); err != nil { - return err + if !errors.Is(err, errors.ErrUnsupported) { + return err + } + + s.log.WithError(err).Warn("Old process cannot be terminated") } var ctx context.Context @@ -242,6 +248,110 @@ func (s *Supervisor) Stop() { } } +// maybeKillPidFile checks kills the process in the pidFile if it's has +// the same binary as the supervisor's and also checks that the env +// `_KOS_MANAGED=yes`. This function does not delete the old pidFile as +// this is done by the caller. +func (s *Supervisor) maybeKillPidFile() error { + pid, err := os.ReadFile(s.PidFile) + if os.IsNotExist(err) { + return nil + } else if err != nil { + return fmt.Errorf("failed to read PID file %s: %w", s.PidFile, err) + } + + p, err := strconv.Atoi(strings.TrimSuffix(string(pid), "\n")) + if err != nil { + return fmt.Errorf("failed to parse PID file %s: %w", s.PidFile, err) + } + + ph, err := newProcHandle(p) + if err != nil { + return fmt.Errorf("cannot interact with PID %d from PID file %s: %w", p, s.PidFile, err) + } + + if err := s.killProcess(ph); err != nil { + return fmt.Errorf("failed to kill PID %d from PID file %s: %w", p, s.PidFile, err) + } + + return nil +} + +const exitCheckInterval = 200 * time.Millisecond + +// Tries to terminate a process gracefully. If it's still running after +// s.TimeoutStop, the process is forcibly terminated. +func (s *Supervisor) killProcess(ph procHandle) error { + // Kill the process pid + deadlineTicker := time.NewTicker(s.TimeoutStop) + defer deadlineTicker.Stop() + checkTicker := time.NewTicker(exitCheckInterval) + defer checkTicker.Stop() + +Loop: + for { + select { + case <-checkTicker.C: + shouldKill, err := s.shouldKillProcess(ph) + if err != nil { + return err + } + if !shouldKill { + return nil + } + + err = ph.terminateGracefully() + if errors.Is(err, syscall.ESRCH) { + return nil + } else if err != nil { + return fmt.Errorf("failed to terminate gracefully: %w", err) + } + case <-deadlineTicker.C: + break Loop + } + } + + shouldKill, err := s.shouldKillProcess(ph) + if err != nil { + return err + } + if !shouldKill { + return nil + } + + err = ph.terminateForcibly() + if errors.Is(err, syscall.ESRCH) { + return nil + } else if err != nil { + return fmt.Errorf("failed to terminate forcibly: %w", err) + } + return nil +} + +func (s *Supervisor) shouldKillProcess(ph procHandle) (bool, error) { + // only kill process if it has the expected cmd + if cmd, err := ph.cmdline(); err != nil { + if errors.Is(err, syscall.ESRCH) { + return false, nil + } + return false, err + } else if len(cmd) > 0 && cmd[0] != s.BinPath { + return false, nil + } + + //only kill process if it has the _KOS_MANAGED env set + if env, err := ph.environ(); err != nil { + if errors.Is(err, syscall.ESRCH) { + return false, nil + } + return false, err + } else if !slices.Contains(env, k0sManaged) { + return false, nil + } + + return true, nil +} + // Prepare the env for exec: // - handle component specific env // - inject k0s embedded bins into path diff --git a/pkg/supervisor/supervisor_unix.go b/pkg/supervisor/supervisor_unix.go index ae09e0bb3179..d06516f67bd9 100644 --- a/pkg/supervisor/supervisor_unix.go +++ b/pkg/supervisor/supervisor_unix.go @@ -23,15 +23,9 @@ import ( "fmt" "os" "path/filepath" - "slices" "strconv" "strings" "syscall" - "time" -) - -const ( - exitCheckInterval = 200 * time.Millisecond ) type unixPID int @@ -40,108 +34,6 @@ func newProcHandle(pid int) (procHandle, error) { return unixPID(pid), nil } -// Tries to terminate a process gracefully. If it's still running after -// s.TimeoutStop, the process is forcibly terminated. -func (s *Supervisor) killProcess(ph procHandle) error { - // Kill the process pid - deadlineTicker := time.NewTicker(s.TimeoutStop) - defer deadlineTicker.Stop() - checkTicker := time.NewTicker(exitCheckInterval) - defer checkTicker.Stop() - -Loop: - for { - select { - case <-checkTicker.C: - shouldKill, err := s.shouldKillProcess(ph) - if err != nil { - return err - } - if !shouldKill { - return nil - } - - err = ph.terminateGracefully() - if errors.Is(err, syscall.ESRCH) { - return nil - } else if err != nil { - return fmt.Errorf("failed to terminate gracefully: %w", err) - } - case <-deadlineTicker.C: - break Loop - } - } - - shouldKill, err := s.shouldKillProcess(ph) - if err != nil { - return err - } - if !shouldKill { - return nil - } - - err = ph.terminateForcibly() - if errors.Is(err, syscall.ESRCH) { - return nil - } else if err != nil { - return fmt.Errorf("failed to terminate forcibly: %w", err) - } - return nil -} - -// maybeKillPidFile checks kills the process in the pidFile if it's has -// the same binary as the supervisor's and also checks that the env -// `_KOS_MANAGED=yes`. This function does not delete the old pidFile as -// this is done by the caller. -func (s *Supervisor) maybeKillPidFile() error { - pid, err := os.ReadFile(s.PidFile) - if os.IsNotExist(err) { - return nil - } else if err != nil { - return fmt.Errorf("failed to read pid file %s: %w", s.PidFile, err) - } - - p, err := strconv.Atoi(strings.TrimSuffix(string(pid), "\n")) - if err != nil { - return fmt.Errorf("failed to parse pid file %s: %w", s.PidFile, err) - } - - ph, err := newProcHandle(p) - if err != nil { - return err - } - - if err := s.killProcess(ph); err != nil { - return fmt.Errorf("failed to kill process with PID %d: %w", p, err) - } - - return nil -} - -func (s *Supervisor) shouldKillProcess(ph procHandle) (bool, error) { - // only kill process if it has the expected cmd - if cmd, err := ph.cmdline(); err != nil { - if errors.Is(err, syscall.ESRCH) { - return false, nil - } - return false, err - } else if len(cmd) > 0 && cmd[0] != s.BinPath { - return false, nil - } - - //only kill process if it has the _KOS_MANAGED env set - if env, err := ph.environ(); err != nil { - if errors.Is(err, syscall.ESRCH) { - return false, nil - } - return false, err - } else if !slices.Contains(env, k0sManaged) { - return false, nil - } - - return true, nil -} - func (pid unixPID) cmdline() ([]string, error) { cmdline, err := os.ReadFile(filepath.Join("/proc", strconv.Itoa(int(pid)), "cmdline")) if err != nil { diff --git a/pkg/supervisor/supervisor_windows.go b/pkg/supervisor/supervisor_windows.go index 9666d701c5c0..a1f5c826a26f 100644 --- a/pkg/supervisor/supervisor_windows.go +++ b/pkg/supervisor/supervisor_windows.go @@ -16,10 +16,11 @@ limitations under the License. package supervisor -// maybeKillPidFile checks kills the process in the pidFile if it's has -// the same binary as the supervisor's. This function does not delete -// the old pidFile as this is done by the caller. -func (s *Supervisor) maybeKillPidFile() error { - s.log.Warnf("maybeKillPidFile is not implemented on Windows") - return nil +import ( + "syscall" +) + +// newProcHandle is not implemented on Windows. +func newProcHandle(int) (procHandle, error) { + return nil, syscall.EWINDOWS } From ceaa0f9410d40806cbdfb5f11e7a6888b9315f71 Mon Sep 17 00:00:00 2001 From: Tom Wieczorek Date: Tue, 22 Oct 2024 10:26:03 +0200 Subject: [PATCH 8/8] Rename OS-specific files from Supervisor to procHandle The supervisor code is now completely OS independent. It uses the procHandle interface to abstract away any OS specifics. Rename the old OS-specific supervisor files to prochandle, since that's what they contain now. Signed-off-by: Tom Wieczorek --- pkg/supervisor/{supervisor_unix.go => prochandle_unix.go} | 0 pkg/supervisor/{supervisor_windows.go => prochandle_windows.go} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename pkg/supervisor/{supervisor_unix.go => prochandle_unix.go} (100%) rename pkg/supervisor/{supervisor_windows.go => prochandle_windows.go} (100%) diff --git a/pkg/supervisor/supervisor_unix.go b/pkg/supervisor/prochandle_unix.go similarity index 100% rename from pkg/supervisor/supervisor_unix.go rename to pkg/supervisor/prochandle_unix.go diff --git a/pkg/supervisor/supervisor_windows.go b/pkg/supervisor/prochandle_windows.go similarity index 100% rename from pkg/supervisor/supervisor_windows.go rename to pkg/supervisor/prochandle_windows.go