mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-18 00:47:48 +08:00
controller: set absolute path of server binary before execution
Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
parent
ed9ea2476d
commit
54f4dc8f6e
@ -296,7 +296,12 @@ func (c *buildxController) Kill(ctx context.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func launch(ctx context.Context, logFile string, args ...string) (func() error, error) {
|
func launch(ctx context.Context, logFile string, args ...string) (func() error, error) {
|
||||||
bCmd := exec.CommandContext(ctx, os.Args[0], args...)
|
// set absolute path of binary, since we set the working directory to the root
|
||||||
|
pathname, err := filepath.Abs(os.Args[0])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
bCmd := exec.CommandContext(ctx, pathname, args...)
|
||||||
if logFile != "" {
|
if logFile != "" {
|
||||||
f, err := os.OpenFile(logFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
|
f, err := os.OpenFile(logFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user