mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
pkg/pidfile: Write(): take pid as argument
This allows it to be used for processes other than the daemon itself. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -139,7 +139,7 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
|
||||
potentiallyUnderRuntimeDir := []string{cli.Config.ExecRoot}
|
||||
|
||||
if cli.Pidfile != "" {
|
||||
if err := pidfile.Write(cli.Pidfile); err != nil {
|
||||
if err = pidfile.Write(cli.Pidfile, os.Getpid()); err != nil {
|
||||
return errors.Wrap(err, "failed to start daemon")
|
||||
}
|
||||
potentiallyUnderRuntimeDir = append(potentiallyUnderRuntimeDir, cli.Pidfile)
|
||||
|
||||
Reference in New Issue
Block a user