@@ -72,15 +72,15 @@ func CLI() error {
7272 // We alert the user instead of failing the command since it can be difficult to debug
7373 // for a template admin otherwise. It's quite possible (and easy) to set an
7474 // 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 )
7676 }
7777
7878 err = writeOOMScoreAdj (* oom )
7979 if err != nil {
8080 // We alert the user instead of failing the command since it can be difficult to debug
8181 // for a template admin otherwise. It's quite possible (and easy) to set an
8282 // 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 )
8484 }
8585
8686 path , err := exec .LookPath (args [0 ])
@@ -138,7 +138,7 @@ func oomScoreAdj() (int, error) {
138138}
139139
140140func 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 )
142142}
143143
144144// execArgs returns the arguments to pass to syscall.Exec after the "--" delimiter.
0 commit comments