diff --git a/main.go b/main.go index 3c909aa..4a26796 100644 --- a/main.go +++ b/main.go @@ -164,15 +164,14 @@ func (d ofsDriver) Mount(r *volume.MountRequest) (*volume.MountResponse, error) return &volume.MountResponse{}, err } - var opts string + // Note: The first argument ("mount") causes running in the foreground, its absence in the background + var cmd *exec.Cmd if len(v.opts) == 0 { - opts = "" + cmd = exec.Command("/sbin/mount.objectivefs", "mount", v.fs, v.volume.Mountpoint) } else { - opts = "-o" + v.opts + cmd = exec.Command("/sbin/mount.objectivefs", "mount", "-o"+v.opts, v.fs, v.volume.Mountpoint) } - // Note: The first argument ("mount") causes running in the foreground, its absence in the background - cmd := exec.Command("/sbin/mount.objectivefs", "mount", opts, v.fs, v.volume.Mountpoint) cmd.Env = v.env cmdReader, _ := cmd.StderrPipe() log.WithFields(log.Fields{ @@ -194,7 +193,7 @@ func (d ofsDriver) Mount(r *volume.MountRequest) (*volume.MountResponse, error) // to initially connect. So we just wait a fixed amount of time and check for process exit. time.Sleep(1 * time.Second) if cmd.ProcessState.Exited() { - return &volume.MountResponse{}, fmt.Errorf("unexpected error mounting '%s' exist status: %d", r.Name, cmd.ProcessState.ExitCode()) + return &volume.MountResponse{}, fmt.Errorf("unexpected error mounting '%s' exist status: %v", r.Name, cmd.ProcessState.ExitCode()) } v.mounted = true