Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit24d44b4

Browse files
authored
fix: add additional context to agent exec errors (#15676)
1 parentb830c05 commit24d44b4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎agent/agentexec/cli_linux.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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
iferr!=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

140140
funcwriteOOMScoreAdj(scoreint)error {
141-
returnos.WriteFile("/proc/self/oom_score_adj", []byte(fmt.Sprintf("%d",score)),0o600)
141+
returnos.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

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp