@@ -72,15 +72,15 @@ func CLI() error {
72
72
// We alert the user instead of failing the command since it can be difficult to debug
73
73
// for a template admin otherwise. It's quite possible (and easy) to set an
74
74
// inappriopriate value for niceness.
75
- printfStdErr ("failed to adjust niceness to %q : %v" , * nice , err )
75
+ printfStdErr ("failed to adjust niceness to %d for cmd %+v : %v" , * nice , args , err )
76
76
}
77
77
78
78
err = writeOOMScoreAdj (* oom )
79
79
if err != nil {
80
80
// We alert the user instead of failing the command since it can be difficult to debug
81
81
// for a template admin otherwise. It's quite possible (and easy) to set an
82
82
// inappriopriate value for oom_score_adj.
83
- printfStdErr ("failed to adjust oom score to %q : %v" , * nice , err )
83
+ printfStdErr ("failed to adjust oom score to %d for cmd %+v : %v" , * oom , args , err )
84
84
}
85
85
86
86
path , err := exec .LookPath (args [0 ])
@@ -138,7 +138,7 @@ func oomScoreAdj() (int, error) {
138
138
}
139
139
140
140
func writeOOMScoreAdj (score int ) error {
141
- return os .WriteFile ("/proc/self /oom_score_adj" , []byte (fmt .Sprintf ("%d" , score )), 0o600 )
141
+ return os .WriteFile (fmt . Sprintf ( "/proc/%d /oom_score_adj" , os . Getpid ()) , []byte (fmt .Sprintf ("%d" , score )), 0o600 )
142
142
}
143
143
144
144
// execArgs returns the arguments to pass to syscall.Exec after the "--" delimiter.
0 commit comments