diff --git a/cmd/start.go b/cmd/start.go index 7b8cabd..ea50b23 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -222,16 +222,21 @@ func jailZfsDatasets(jail *Jail) error { } // Mount from inside jail if mountpoint is set - cmd = fmt.Sprintf("zfs get -H -o value mountpoint %s/%s", jail.JID, jail.Zpool, d) + cmd = fmt.Sprintf("zfs get -H -o value mountpoint %s/%s", jail.Zpool, d) out, err = executeCommand(cmd) if err != nil { - return errors.New(fmt.Sprintf("Error getting zfs dataset %s mountpoint: %v: out", d, err, out)) + return errors.New(fmt.Sprintf("Error getting zfs dataset %s/%s mountpoint: %v: %s", jail.Zpool, d, err, out)) } if len(out) > 0 && out != "-" && (false == strings.EqualFold(out, "none")) { - cmd = fmt.Sprintf("zfs mount %s", jail.Zpool, d) + //cmd = fmt.Sprintf("zfs mount %s/%s", jail.Zpool, d) + cmd = fmt.Sprintf("zfs mount -a") out, err = executeCommandInJail(jail, cmd) if err != nil { - return errors.New(fmt.Sprintf("Error mounting zfs dataset %s: %v: out", d, err, out)) + // If already mounted, continue processing + if ! strings.HasSuffix(out, "filesystem already mounted\n") { + //return errors.New(fmt.Sprintf("Error mounting zfs dataset %s/%s: %v: %s", jail.Zpool, d, err, out)) + return errors.New(fmt.Sprintf("Error executing \"zfs mount -a\" from inside jail: %v: %s", err, out)) + } } } }