Skip to content

Commit

Permalink
Merge pull request #118 from changweige/nydusd-log
Browse files Browse the repository at this point in the history
enhance how nydusd's log are logged and redirected
  • Loading branch information
changweige authored Aug 2, 2022
2 parents e3b70b1 + d3252b6 commit c360523
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions misc/snapshotter/nydus-snapshotter.fscache.service
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Restart=always
RestartSec=1
KillMode=process
OOMScoreAdjust=-999
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target
2 changes: 2 additions & 0 deletions misc/snapshotter/nydus-snapshotter.fusedev.service
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Restart=always
RestartSec=1
KillMode=process
OOMScoreAdjust=-999
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target
9 changes: 5 additions & 4 deletions pkg/process/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,11 @@ func (m *Manager) buildStartCommand(d *daemon.Daemon) (*exec.Cmd, error) {
log.L.Infof("start nydus daemon: %s %s", m.nydusdBinaryPath, strings.Join(args, " "))

cmd := exec.Command(m.nydusdBinaryPath, args...)
if d.LogToStdout {
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stdout
}
// nydusd standard output and standard error rather than its logs are
// always redirected to snapshotter's respectively
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr

return cmd, nil
}

Expand Down

0 comments on commit c360523

Please sign in to comment.