Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion cmd/config-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,16 @@ func signalProcess(f *Flags) error {
return nil
}

// cmdlineMatchesProcessTarget reports whether argv[0] matches the configured signal target.
// The container command is often "mps-control-daemon" while PROCESS_TO_SIGNAL may be set to
// "/usr/bin/mps-control-daemon"; compare basenames so shareProcessNamespace pods can signal.
func cmdlineMatchesProcessTarget(argv0, target string) bool {
if argv0 == target {
return true
}
return filepath.Base(argv0) == filepath.Base(target)
}

func findPidToSignal(f *Flags) (int, error) {
procs, err := procfs.AllProcs()
if err != nil {
Expand All @@ -456,7 +466,7 @@ func findPidToSignal(f *Flags) (int, error) {
if len(cmdline) == 0 {
continue
}
if cmdline[0] == f.ProcessToSignal {
if cmdlineMatchesProcessTarget(cmdline[0], f.ProcessToSignal) {
return p.PID, nil
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ spec:
- name: SIGNAL
value: "1"
- name: PROCESS_TO_SIGNAL
value: "/usr/bin/mps-control-daemon"
value: "mps-control-daemon"
volumeMounts:
- name: available-configs
mountPath: /available-configs
Expand Down