mountlib: restore daemon mode after #5415
This commit is contained in:
parent
63a24255f8
commit
55e766f4e8
2 changed files with 11 additions and 11 deletions
|
@ -145,8 +145,8 @@ func NewMountCommand(commandName string, hidden bool, mount MountFn) *cobra.Comm
|
||||||
VFSOpt: vfsflags.Opt,
|
VFSOpt: vfsflags.Opt,
|
||||||
}
|
}
|
||||||
|
|
||||||
err := mnt.Mount()
|
daemonized, err := mnt.Mount()
|
||||||
if err == nil {
|
if !daemonized && err == nil {
|
||||||
err = mnt.Wait()
|
err = mnt.Wait()
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -167,21 +167,21 @@ func NewMountCommand(commandName string, hidden bool, mount MountFn) *cobra.Comm
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mount the remote at mountpoint
|
// Mount the remote at mountpoint
|
||||||
func (m *MountPoint) Mount() (err error) {
|
func (m *MountPoint) Mount() (daemonized bool, err error) {
|
||||||
if err = m.CheckOverlap(); err != nil {
|
if err = m.CheckOverlap(); err != nil {
|
||||||
return err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = m.CheckAllowings(); err != nil {
|
if err = m.CheckAllowings(); err != nil {
|
||||||
return err
|
return false, err
|
||||||
}
|
}
|
||||||
m.SetVolumeName(m.MountOpt.VolumeName)
|
m.SetVolumeName(m.MountOpt.VolumeName)
|
||||||
|
|
||||||
// Start background task if --background is specified
|
// Start background task if --daemon is specified
|
||||||
if m.MountOpt.Daemon {
|
if m.MountOpt.Daemon {
|
||||||
daemonized := startBackgroundMode()
|
daemonized = startBackgroundMode()
|
||||||
if daemonized {
|
if daemonized {
|
||||||
return nil
|
return true, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,9 +189,9 @@ func (m *MountPoint) Mount() (err error) {
|
||||||
|
|
||||||
m.ErrChan, m.UnmountFn, err = m.MountFn(m.VFS, m.MountPoint, &m.MountOpt)
|
m.ErrChan, m.UnmountFn, err = m.MountFn(m.VFS, m.MountPoint, &m.MountOpt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to mount FUSE fs")
|
return false, errors.Wrap(err, "failed to mount FUSE fs")
|
||||||
}
|
}
|
||||||
return nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CheckOverlap checks that root doesn't overlap with mountpoint
|
// CheckOverlap checks that root doesn't overlap with mountpoint
|
||||||
|
|
|
@ -270,7 +270,7 @@ func (vol *Volume) mount(id string) error {
|
||||||
return errors.New("volume filesystem is not ready")
|
return errors.New("volume filesystem is not ready")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := vol.mnt.Mount(); err != nil {
|
if _, err := vol.mnt.Mount(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
vol.mnt.MountedOn = time.Now()
|
vol.mnt.MountedOn = time.Now()
|
||||||
|
|
Loading…
Reference in a new issue